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

Fixed sticky INFO (which persisted across TEST_CASEs) from #152 and generated build 18

Commit
d768b1b7f93a87a869bd6ce816d02d460788f100
Author
Phil Nash ·
Parents
fb944f2b6b1d

Files · Download .tar.gz

Changes

 README                                          |  2 +-
 include/internal/catch_runner_impl.hpp          |  2 +
 include/internal/catch_version.hpp              |  2 +-
 projects/SelfTest/Baselines/approvedResults.txt | 53 ++++++++++++++++++++++---
 projects/SelfTest/MessageTests.cpp              |  9 +++++
 single_include/catch.hpp                        |  8 ++--
 6 files changed, 65 insertions(+), 11 deletions(-)

diff --git a/README b/README
index 5c8f882e..42812e92 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-CATCH v0.9 build 17 (integration branch)
+CATCH v0.9 build 18 (integration branch)
 ---------------------------------------------
 
 CATCH is an automated test framework for C, C++ and Objective-C.
diff --git a/include/internal/catch_runner_impl.hpp b/include/internal/catch_runner_impl.hpp
index 7ff442c2..b51a3828 100644
--- a/include/internal/catch_runner_impl.hpp
+++ b/include/internal/catch_runner_impl.hpp
@@ -267,6 +267,7 @@ namespace Catch {
             try {
                 m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCase().getTestCaseInfo().lineInfo, "", ResultDisposition::Normal );
                 m_runningTest->reset();
+                
                 if( m_reporter->getPreferences().shouldRedirectStdOut ) {
                     StreamRedirect coutRedir( std::cout, redirectedCout );
                     StreamRedirect cerrRedir( std::cerr, redirectedCerr );
@@ -285,6 +286,7 @@ namespace Catch {
                 exResult << translateActiveException();
                 actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo )  );
             }
+            m_messages.clear();
         }
 
     private:
diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp
index 42bf18ff..380ffcb4 100644
--- a/include/internal/catch_version.hpp
+++ b/include/internal/catch_version.hpp
@@ -13,7 +13,7 @@
 namespace Catch {
 
     // These numbers are maintained by a script
-    Version libraryVersion( 0, 9, 17, "integration" );
+    Version libraryVersion( 0, 9, 18, "integration" );
 }
 
 #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED
diff --git a/projects/SelfTest/Baselines/approvedResults.txt b/projects/SelfTest/Baselines/approvedResults.txt
index cdce6d3a..eaaa6139 100644
--- a/projects/SelfTest/Baselines/approvedResults.txt
+++ b/projects/SelfTest/Baselines/approvedResults.txt
@@ -2228,6 +2228,22 @@ MessageTests.cpp:92:
 
 No assertions in test case, './succeeding/nofail'
 
+-------------------------------------------------------------------------------
+just info
+...............................................................................
+
+
+No assertions in test case, 'just info'
+
+-------------------------------------------------------------------------------
+just failure
+...............................................................................
+
+FAILED:
+explicitly with message:
+  Previous info should not be seen
+MessageTests.cpp:101:
+
 -------------------------------------------------------------------------------
 ./succeeding/Misc/Sections
   s1
@@ -4235,7 +4251,7 @@ with expansion:
 BDDTests.cpp:29:
 
 ===============================================================================
-96 test cases - 45 failed (610 assertions - 102 failed)
+98 test cases - 47 failed (612 assertions - 104 failed)
 
 
 CatchSelfTest is a CATCH v0.9 b17 (integration) host application.
@@ -4517,7 +4533,7 @@ ConditionTests.cpp:72:
 12 test cases - 3 failed (38 assertions - 4 failed)
 
 <testsuites>
-  <testsuite name="~dummy" errors="8" failures="77" tests="610" hostname="tbd" time="tbd" timestamp="tbd">
+  <testsuite name="~dummy" errors="8" failures="78" tests="612" hostname="tbd" time="tbd" timestamp="tbd">
     <testcase classname="global" name="./succeeding/Approx/simple" time="tbd"/>
     <testcase classname="global" name="./succeeding/Approx/epsilon" time="tbd"/>
     <testcase classname="global" name="./succeeding/Approx/float" time="tbd"/>
@@ -4783,6 +4799,12 @@ MessageTests.cpp:86
 MessageTests.cpp:92
       </failure>
     </testcase>
+    <testcase classname="global" name="just info" time="tbd"/>
+    <testcase classname="global" name="just failure" time="tbd">
+      <failure type="FAIL">
+MessageTests.cpp:101
+      </failure>
+    </testcase>
     <testcase classname="global" name="./succeeding/Misc/Sections" time="tbd"/>
     <testcase classname="global" name="./succeeding/Misc/Sections/nested" time="tbd"/>
     <testcase classname="global" name="./mixed/Misc/Sections/nested2" time="tbd">
@@ -7767,6 +7789,15 @@ MessageTests.cpp" line="92">
       </Expression>
       <OverallResult success="false"/>
     </TestCase>
+    <TestCase name="just info">
+      <OverallResult success="true"/>
+    </TestCase>
+    <TestCase name="just failure">
+      <Failure>
+        Previous info should not be seen
+      </Failure>
+      <OverallResult success="false"/>
+    </TestCase>
     <TestCase name="./succeeding/Misc/Sections">
       <Section name="s1" description="doesn't equal">
 MiscTests.cpp" line="25">
@@ -9754,9 +9785,9 @@ BDDTests.cpp" line="29">
       </Section>
       <OverallResult success="true"/>
     </TestCase>
-    <OverallResults successes="508" failures="102"/>
+    <OverallResults successes="508" failures="104"/>
   </Group>
-  <OverallResults successes="508" failures="102"/>
+  <OverallResults successes="508" failures="104"/>
 </Catch>
 [Started testing: CatchSelfTest]
 [Started group: '~dummy']
@@ -10262,6 +10293,16 @@ No assertions in test case, './succeeding/nofail'
 
 [Finished: './succeeding/nofail' 1 test case failed (1 assertion failed)]
 
+[Running: just info]
+
+No assertions in test case, 'just info'
+
+[Finished: 'just info' 1 test case failed (1 assertion failed)]
+
+[Running: just failure]
+MessageTests.cpp:101: failed with message: 'Previous info should not be seen'
+[Finished: 'just failure' 1 test case failed (1 assertion failed)]
+
 [Running: ./succeeding/Misc/Sections]
 [Started section: 's1']
 MiscTests.cpp:25: a != b succeeded for: 1 != 2
@@ -11084,10 +11125,10 @@ BDDTests.cpp:29: itDoesThis() succeeded for: true
 [End of section: ' Given: This stuff exists' 1 assertion passed]
 
 [Finished: 'Scenario: Do that thing with the thing' All tests passed (1 assertion in 1 test case)]
-[End of group: '~dummy'. 45 of 96 test cases failed (102 of 610 assertions failed)]
+[End of group: '~dummy'. 47 of 98 test cases failed (104 of 612 assertions failed)]
 
 
-[Testing completed. 45 of 96 test cases failed (102 of 610 assertions failed)]
+[Testing completed. 47 of 98 test cases failed (104 of 612 assertions failed)]
 
 [Started testing: CatchSelfTest]
 [Started group: '~dummy']
diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp
index bdfa88d3..0e010f6c 100644
--- a/projects/SelfTest/MessageTests.cpp
+++ b/projects/SelfTest/MessageTests.cpp
@@ -91,3 +91,12 @@ TEST_CASE( "./succeeding/nofail", "The NO_FAIL macro reports a failure but does
 {
     CHECK_NOFAIL( 1 == 2 );
 }
+
+TEST_CASE( "just info", "[info][isolated info]" )
+{
+    INFO( "this should never be seen" );
+}
+TEST_CASE( "just failure", "[fail][isolated info]" )
+{
+    FAIL( "Previous info should not be seen" );
+}
diff --git a/single_include/catch.hpp b/single_include/catch.hpp
index 0700af82..025f3c46 100644
--- a/single_include/catch.hpp
+++ b/single_include/catch.hpp
@@ -1,6 +1,6 @@
 /*
- *  CATCH v0.9 build 17 (integration branch)
- *  Generated: 2013-02-02 20:37:06.007152
+ *  CATCH v0.9 build 18 (integration branch)
+ *  Generated: 2013-02-04 00:03:53.198397
  *  ----------------------------------------------------------
  *  This file has been merged from multiple headers. Please don't edit it directly
  *  Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
@@ -4594,6 +4594,7 @@ namespace Catch {
             try {
                 m_lastAssertionInfo = AssertionInfo( "TEST_CASE", m_runningTest->getTestCase().getTestCaseInfo().lineInfo, "", ResultDisposition::Normal );
                 m_runningTest->reset();
+
                 if( m_reporter->getPreferences().shouldRedirectStdOut ) {
                     StreamRedirect coutRedir( std::cout, redirectedCout );
                     StreamRedirect cerrRedir( std::cerr, redirectedCerr );
@@ -4612,6 +4613,7 @@ namespace Catch {
                 exResult << translateActiveException();
                 actOnCurrentResult( exResult.buildResult( m_lastAssertionInfo )  );
             }
+            m_messages.clear();
         }
 
     private:
@@ -5814,7 +5816,7 @@ namespace Catch {
 namespace Catch {
 
     // These numbers are maintained by a script
-    Version libraryVersion( 0, 9, 17, "integration" );
+    Version libraryVersion( 0, 9, 18, "integration" );
 }
 
 // #included from: catch_line_wrap.hpp