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

Remove obsoleted `SCOPED_MSG` and `SCOPED_CAPTURE`

Standard `MSG` and `CAPTURE` behave the same way these used to,
and are recommended instead.
Commit
3382312bd8300f6b11fc627632ed4e5b466650d2
Author
Martin Hořeňovský ·
Parents
5da76bb7be3b

Files · Download .tar.gz

Changes

 include/catch.hpp                                  |   4 -
 .../SelfTest/Baselines/console.std.approved.txt    |  28 +--
 .../SelfTest/Baselines/console.sw.approved.txt     | 208 ++++++++++-----------
 projects/SelfTest/MessageTests.cpp                 |   6 +-
 4 files changed, 121 insertions(+), 125 deletions(-)

diff --git a/include/catch.hpp b/include/catch.hpp
index 58d8c9d5..b830c97e 100644
--- a/include/catch.hpp
+++ b/include/catch.hpp
@@ -100,9 +100,7 @@
 
 #define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg )
 #define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( "CATCH_WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
-#define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg )
 #define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( "CATCH_CAPTURE", #msg " := " << ::Catch::Detail::stringify(msg) )
-#define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( "CATCH_CAPTURE", #msg " := " << ::Catch::Detail::stringify(msg) )
 
 #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
 #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
@@ -163,9 +161,7 @@
 
 #define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg )
 #define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
-#define SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg )
 #define CAPTURE( msg ) INTERNAL_CATCH_INFO( "CAPTURE", #msg " := " << ::Catch::Detail::stringify(msg) )
-#define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( "CAPTURE", #msg " := " << ::Catch::Detail::stringify(msg) )
 
 #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
 #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt
index c01923c1..7f854c3e 100644
--- a/projects/SelfTest/Baselines/console.std.approved.txt
+++ b/projects/SelfTest/Baselines/console.std.approved.txt
@@ -422,6 +422,20 @@ with messages:
   this message should be logged
   and this, but later
 
+-------------------------------------------------------------------------------
+INFO is reset for each loop
+-------------------------------------------------------------------------------
+MessageTests.cpp:<line number>
+...............................................................................
+
+MessageTests.cpp:<line number>: FAILED:
+  REQUIRE( i < 10 )
+with expansion:
+  10 < 10
+with messages:
+  current counter 10
+  i := 10
+
 -------------------------------------------------------------------------------
 Inequality checks that should fail
 -------------------------------------------------------------------------------
@@ -655,20 +669,6 @@ DecompositionTests.cpp:<line number>: FAILED:
 with expansion:
   Hey, its truthy!
 
--------------------------------------------------------------------------------
-SCOPED_INFO is reset for each loop
--------------------------------------------------------------------------------
-MessageTests.cpp:<line number>
-...............................................................................
-
-MessageTests.cpp:<line number>: FAILED:
-  REQUIRE( i < 10 )
-with expansion:
-  10 < 10
-with messages:
-  current counter 10
-  i := 10
-
 A string sent directly to stdout
 A string sent directly to stderr
 Write to std::cerr
diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt
index 6b64aee8..012ac260 100644
--- a/projects/SelfTest/Baselines/console.sw.approved.txt
+++ b/projects/SelfTest/Baselines/console.sw.approved.txt
@@ -1648,6 +1648,110 @@ with messages:
   and this, but later
   but not this
 
+-------------------------------------------------------------------------------
+INFO is reset for each loop
+-------------------------------------------------------------------------------
+MessageTests.cpp:<line number>
+...............................................................................
+
+MessageTests.cpp:<line number>:
+PASSED:
+  REQUIRE( i < 10 )
+with expansion:
+  0 < 10
+with messages:
+  current counter 0
+  i := 0
+
+MessageTests.cpp:<line number>:
+PASSED:
+  REQUIRE( i < 10 )
+with expansion:
+  1 < 10
+with messages:
+  current counter 1
+  i := 1
+
+MessageTests.cpp:<line number>:
+PASSED:
+  REQUIRE( i < 10 )
+with expansion:
+  2 < 10
+with messages:
+  current counter 2
+  i := 2
+
+MessageTests.cpp:<line number>:
+PASSED:
+  REQUIRE( i < 10 )
+with expansion:
+  3 < 10
+with messages:
+  current counter 3
+  i := 3
+
+MessageTests.cpp:<line number>:
+PASSED:
+  REQUIRE( i < 10 )
+with expansion:
+  4 < 10
+with messages:
+  current counter 4
+  i := 4
+
+MessageTests.cpp:<line number>:
+PASSED:
+  REQUIRE( i < 10 )
+with expansion:
+  5 < 10
+with messages:
+  current counter 5
+  i := 5
+
+MessageTests.cpp:<line number>:
+PASSED:
+  REQUIRE( i < 10 )
+with expansion:
+  6 < 10
+with messages:
+  current counter 6
+  i := 6
+
+MessageTests.cpp:<line number>:
+PASSED:
+  REQUIRE( i < 10 )
+with expansion:
+  7 < 10
+with messages:
+  current counter 7
+  i := 7
+
+MessageTests.cpp:<line number>:
+PASSED:
+  REQUIRE( i < 10 )
+with expansion:
+  8 < 10
+with messages:
+  current counter 8
+  i := 8
+
+MessageTests.cpp:<line number>:
+PASSED:
+  REQUIRE( i < 10 )
+with expansion:
+  9 < 10
+with messages:
+  current counter 9
+  i := 9
+
+MessageTests.cpp:<line number>: FAILED:
+  REQUIRE( i < 10 )
+with expansion:
+  10 < 10
+with messages:
+  current counter 10
+  i := 10
+
 -------------------------------------------------------------------------------
 Inequality checks that should fail
 -------------------------------------------------------------------------------
@@ -3839,110 +3943,6 @@ DecompositionTests.cpp:<line number>: FAILED:
 with expansion:
   Hey, its truthy!
 
--------------------------------------------------------------------------------
-SCOPED_INFO is reset for each loop
--------------------------------------------------------------------------------
-MessageTests.cpp:<line number>
-...............................................................................
-
-MessageTests.cpp:<line number>:
-PASSED:
-  REQUIRE( i < 10 )
-with expansion:
-  0 < 10
-with messages:
-  current counter 0
-  i := 0
-
-MessageTests.cpp:<line number>:
-PASSED:
-  REQUIRE( i < 10 )
-with expansion:
-  1 < 10
-with messages:
-  current counter 1
-  i := 1
-
-MessageTests.cpp:<line number>:
-PASSED:
-  REQUIRE( i < 10 )
-with expansion:
-  2 < 10
-with messages:
-  current counter 2
-  i := 2
-
-MessageTests.cpp:<line number>:
-PASSED:
-  REQUIRE( i < 10 )
-with expansion:
-  3 < 10
-with messages:
-  current counter 3
-  i := 3
-
-MessageTests.cpp:<line number>:
-PASSED:
-  REQUIRE( i < 10 )
-with expansion:
-  4 < 10
-with messages:
-  current counter 4
-  i := 4
-
-MessageTests.cpp:<line number>:
-PASSED:
-  REQUIRE( i < 10 )
-with expansion:
-  5 < 10
-with messages:
-  current counter 5
-  i := 5
-
-MessageTests.cpp:<line number>:
-PASSED:
-  REQUIRE( i < 10 )
-with expansion:
-  6 < 10
-with messages:
-  current counter 6
-  i := 6
-
-MessageTests.cpp:<line number>:
-PASSED:
-  REQUIRE( i < 10 )
-with expansion:
-  7 < 10
-with messages:
-  current counter 7
-  i := 7
-
-MessageTests.cpp:<line number>:
-PASSED:
-  REQUIRE( i < 10 )
-with expansion:
-  8 < 10
-with messages:
-  current counter 8
-  i := 8
-
-MessageTests.cpp:<line number>:
-PASSED:
-  REQUIRE( i < 10 )
-with expansion:
-  9 < 10
-with messages:
-  current counter 9
-  i := 9
-
-MessageTests.cpp:<line number>: FAILED:
-  REQUIRE( i < 10 )
-with expansion:
-  10 < 10
-with messages:
-  current counter 10
-  i := 10
-
 -------------------------------------------------------------------------------
 SUCCEED counts as a test pass
 -------------------------------------------------------------------------------
diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp
index 0faa4d72..437ba53d 100644
--- a/projects/SelfTest/MessageTests.cpp
+++ b/projects/SelfTest/MessageTests.cpp
@@ -102,11 +102,11 @@ TEST_CASE( "Standard error is reported and redirected", "[messages][.]" ) {
     }
 }
 
-TEST_CASE( "SCOPED_INFO is reset for each loop", "[messages][failing][.]" ) {
+TEST_CASE( "INFO is reset for each loop", "[messages][failing][.]" ) {
     for( int i=0; i<100; i++ )
     {
-        SCOPED_INFO( "current counter " << i );
-        SCOPED_CAPTURE( i );
+        INFO( "current counter " << i );
+        CAPTURE( i );
         REQUIRE( i < 10 );
     }
 }