Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Clara: formatting and code tweaks

Commit
ab6dd55fcf81fe08b76c3ced09cb7282157c29b5
Author
Phil Nash ·
Parents
b7632659f58d

Files · Download .tar.gz

Changes

 projects/SelfTest/CmdLineTests.cpp | 36 +++++++-----------------------------
 1 file changed, 7 insertions(+), 29 deletions(-)

diff --git a/projects/SelfTest/CmdLineTests.cpp b/projects/SelfTest/CmdLineTests.cpp
index 868740b0..9fee6d25 100644
--- a/projects/SelfTest/CmdLineTests.cpp
+++ b/projects/SelfTest/CmdLineTests.cpp
@@ -422,14 +422,11 @@ namespace Clara {
         
 
         void usage( std::ostream& os, std::string const& procName ) const {
-            os << "usage:\n";
-            os << "  " << procName << " ";
+            os << "usage:\n  " << procName << " ";
             argSynopsis( os );
             if( !m_options.empty() ) {
-                os << " [options]\n\n";
-                os << "where options are: \n";
-                optUsage( os, 2 );
-                
+                os << " [options]\n\nwhere options are: \n";
+                optUsage( os, 2 );                
             }
             os << "\n";
         }
@@ -561,19 +558,19 @@ TEST_CASE( "cmdline" ) {
         .longOpt( "output" )
         .argName( "filename" );
 
-    SECTION( "plain filename" ) {
+    SECTION( "arg separated by spaces" ) {
         const char* argv[] = { "test", "-o filename.ext" };
         parseInto( cli, argv, config );
         
         CHECK( config.fileName == "filename.ext" );
     }
-    SECTION( "plain filename with colon" ) {
+    SECTION( "arg separated by colon" ) {
         const char* argv[] = { "test", "-o:filename.ext" };
         parseInto( cli, argv, config );
 
         CHECK( config.fileName == "filename.ext" );
     }
-    SECTION( "plain filename with =" ) {
+    SECTION( "arg separated by =" ) {
         const char* argv[] = { "test", "-o=filename.ext" };
         parseInto( cli, argv, config );
 
@@ -765,7 +762,7 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) {
             .describe( "reporter to use - defaults to console" )
             .shortOpt( "r")
             .longOpt( "reporter" )
-            .argName( "reporter name[:filename]" );
+            .argName( "name[:filename]" );
 
         cli.bind( &Config::suiteName )
             .describe( "suite name" )
@@ -843,25 +840,6 @@ SCENARIO( "New Catch commandline interface", "[cli]" ) {
                 REQUIRE( config.testsOrTags[0] == "[hello]" );
             }
         }
-    
     }
-    // !TBD: print positional args in usage
 }
-
-// !TBD still support this?
-//    Clara::Parser<Config>
-//        ( "-h, --help                         display usage information",           &Config::showHelp )
-//        ( "-l, --list                         list all (or matching) test cases",   &Config::listTests )
-//        ( "-t, --tags                         list all (or matching) tags",         &Config::listTags )
-//        ( "-p, --passing                      show passing test output",            &Config::showPassingTests )
-//        ( "-b, --break                        break into debugger on failure",      &Config::breakIntoDebugger )
-//        ( "-e, --nothrow                      Skip exception tests",                &Config::noThrow )
-//        ( "-o, --out <file name>              output filename",                     &Config::fileName )
-//        ( "-n, --name <name>                  suite name",                          &Config::suiteName )
-//        ( "-a, --abort                        abort at first failure",              &Config::abortAfterFirst )
-//        ( "-x, --abortx <number of failures>  abort after x failures",              &Config::abortAfterX )
-//        ( "-w, --warn <warning name>          enables warnings",                    &Config::addWarning );
-//        .parseInto( argc, argv, config );
-
 #endif
-