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

--extra-info -> --list-extra-info, behaves like other --list-* flags

Commit
07c6bfc3b9aa473d41cd4abcd1962c093ca0f531
Author
Martin Hořeňovský ·
Parents
616f7235efc8

Files · Download .tar.gz

Changes

 include/internal/catch_commandline.hpp | 6 +++---
 include/internal/catch_config.hpp      | 6 +++---
 include/internal/catch_list.hpp        | 8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/internal/catch_commandline.hpp b/include/internal/catch_commandline.hpp
index 07115db4..3ece92f8 100644
--- a/include/internal/catch_commandline.hpp
+++ b/include/internal/catch_commandline.hpp
@@ -187,9 +187,9 @@ namespace Catch {
             .describe( "list all/matching test cases names only" )
             .bind( &ConfigData::listTestNamesOnly );
 
-        cli["--extra-info"]
-            .describe( "list more info" )
-            .bind( &ConfigData::extraInfo );
+        cli["--list-extra-info"]
+            .describe( "list all/matching test cases with more info" )
+            .bind( &ConfigData::listExtraInfo );
 
         cli["--list-reporters"]
             .describe( "list all reporters" )
diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp
index 304fe32b..b006d512 100644
--- a/include/internal/catch_config.hpp
+++ b/include/internal/catch_config.hpp
@@ -31,7 +31,7 @@ namespace Catch {
             listTags( false ),
             listReporters( false ),
             listTestNamesOnly( false ),
-            extraInfo( false ),
+            listExtraInfo( false ),
             showSuccessfulTests( false ),
             shouldDebugBreak( false ),
             noThrow( false ),
@@ -51,7 +51,7 @@ namespace Catch {
         bool listTags;
         bool listReporters;
         bool listTestNamesOnly;
-        bool extraInfo;
+        bool listExtraInfo;
 
         bool showSuccessfulTests;
         bool shouldDebugBreak;
@@ -111,7 +111,7 @@ namespace Catch {
         bool listTestNamesOnly() const { return m_data.listTestNamesOnly; }
         bool listTags() const { return m_data.listTags; }
         bool listReporters() const { return m_data.listReporters; }
-        bool extraInfo() const { return m_data.extraInfo; }
+        bool listExtraInfo() const { return m_data.listExtraInfo; }
 
         std::string getProcessName() const { return m_data.processName; }
 
diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp
index b692f4e3..747b17c8 100644
--- a/include/internal/catch_list.hpp
+++ b/include/internal/catch_list.hpp
@@ -47,10 +47,10 @@ namespace Catch {
             Colour colourGuard( colour );
 
             Catch::cout() << Text( testCaseInfo.name, nameAttr ) << std::endl;
-            if( config.extraInfo() ) {
+            if( config.listExtraInfo() ) {
                 Catch::cout() << "    " << testCaseInfo.lineInfo << std::endl;
                 std::string description = testCaseInfo.description;
-                if( description == "" )
+                if( description.empty() )
                     description = "(NO DESCRIPTION)";
                 Catch::cout() << Text( description, descAttr ) << std::endl;
             }
@@ -80,7 +80,7 @@ namespace Catch {
                Catch::cout() << '"' << testCaseInfo.name << '"';
             else
                Catch::cout() << testCaseInfo.name;
-            if ( config.extraInfo() )
+            if ( config.listExtraInfo() )
                 Catch::cout() << "\t@" << testCaseInfo.lineInfo;
             Catch::cout() << std::endl;
         }
@@ -174,7 +174,7 @@ namespace Catch {
 
     inline Option<std::size_t> list( Config const& config ) {
         Option<std::size_t> listedCount;
-        if( config.listTests() )
+        if( config.listTests() || config.listExtraInfo() )
             listedCount = listedCount.valueOr(0) + listTests( config );
         if( config.listTestNamesOnly() )
             listedCount = listedCount.valueOr(0) + listTestsNamesOnly( config );