mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Big assertion capture refactoring.
- moved as much logic out of the macros as possible - moved most logic into new ResultBuilder class, which wraps ExpressionResultBuilder (may take it over next), subsumes ResultAction and also takes place of ExpressionDecomposer. This introduces many SRP violations - but all in the name of minimising macro logic!
This commit is contained in:
		| @@ -5683,7 +5683,7 @@ TrickyTests.cpp:<line number> | ||||
|  | ||||
| TrickyTests.cpp:<line number>: | ||||
| PASSED: | ||||
|   REQUIRE( Catch::isTrue( true ) ) | ||||
|   REQUIRE( Catch::alwaysTrue() ) | ||||
| with expansion: | ||||
|   true | ||||
|  | ||||
| @@ -5696,7 +5696,7 @@ TrickyTests.cpp:<line number> | ||||
|  | ||||
| TrickyTests.cpp:<line number>: | ||||
| PASSED: | ||||
|   REQUIRE( Catch::isTrue( true ) ) | ||||
|   REQUIRE( Catch::alwaysTrue() ) | ||||
| with expansion: | ||||
|   true | ||||
|  | ||||
| @@ -5710,7 +5710,7 @@ TrickyTests.cpp:<line number> | ||||
|  | ||||
| TrickyTests.cpp:<line number>: | ||||
| PASSED: | ||||
|   REQUIRE( Catch::isTrue( true ) ) | ||||
|   REQUIRE( Catch::alwaysTrue() ) | ||||
| with expansion: | ||||
|   true | ||||
|  | ||||
| @@ -5722,7 +5722,7 @@ TrickyTests.cpp:<line number> | ||||
|  | ||||
| TrickyTests.cpp:<line number>: | ||||
| PASSED: | ||||
|   REQUIRE( Catch::isTrue( true ) ) | ||||
|   REQUIRE( Catch::alwaysTrue() ) | ||||
| with expansion: | ||||
|   true | ||||
|  | ||||
| @@ -5735,7 +5735,7 @@ TrickyTests.cpp:<line number> | ||||
|  | ||||
| TrickyTests.cpp:<line number>: | ||||
| PASSED: | ||||
|   REQUIRE( Catch::isTrue( true ) ) | ||||
|   REQUIRE( Catch::alwaysTrue() ) | ||||
| with expansion: | ||||
|   true | ||||
|  | ||||
| @@ -5749,7 +5749,7 @@ TrickyTests.cpp:<line number> | ||||
|  | ||||
| TrickyTests.cpp:<line number>: | ||||
| PASSED: | ||||
|   REQUIRE( Catch::isTrue( true ) ) | ||||
|   REQUIRE( Catch::alwaysTrue() ) | ||||
| with expansion: | ||||
|   true | ||||
|  | ||||
|   | ||||
| @@ -5849,7 +5849,7 @@ there" | ||||
|     <TestCase name="Assertions then sections"> | ||||
|       <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" > | ||||
|         <Original> | ||||
|           Catch::isTrue( true ) | ||||
|           Catch::alwaysTrue() | ||||
|         </Original> | ||||
|         <Expanded> | ||||
|           true | ||||
| @@ -5858,7 +5858,7 @@ there" | ||||
|       <Section name="A section"> | ||||
|         <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" > | ||||
|           <Original> | ||||
|             Catch::isTrue( true ) | ||||
|             Catch::alwaysTrue() | ||||
|           </Original> | ||||
|           <Expanded> | ||||
|             true | ||||
| @@ -5867,7 +5867,7 @@ there" | ||||
|         <Section name="Another section"> | ||||
|           <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" > | ||||
|             <Original> | ||||
|               Catch::isTrue( true ) | ||||
|               Catch::alwaysTrue() | ||||
|             </Original> | ||||
|             <Expanded> | ||||
|               true | ||||
| @@ -5879,7 +5879,7 @@ there" | ||||
|       </Section> | ||||
|       <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" > | ||||
|         <Original> | ||||
|           Catch::isTrue( true ) | ||||
|           Catch::alwaysTrue() | ||||
|         </Original> | ||||
|         <Expanded> | ||||
|           true | ||||
| @@ -5888,7 +5888,7 @@ there" | ||||
|       <Section name="A section"> | ||||
|         <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" > | ||||
|           <Original> | ||||
|             Catch::isTrue( true ) | ||||
|             Catch::alwaysTrue() | ||||
|           </Original> | ||||
|           <Expanded> | ||||
|             true | ||||
| @@ -5897,7 +5897,7 @@ there" | ||||
|         <Section name="Another other section"> | ||||
|           <Expression success="true" filename="/Users/philnash/Dev/OSS/Catch/projects/SelfTest/TrickyTests.cpp" > | ||||
|             <Original> | ||||
|               Catch::isTrue( true ) | ||||
|               Catch::alwaysTrue() | ||||
|             </Original> | ||||
|             <Expanded> | ||||
|               true | ||||
|   | ||||
| @@ -22,42 +22,42 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|     Catch::TestCase tcC = fakeTestCase( "longer name with spaces", "[two][three][.][x]" ); | ||||
|     Catch::TestCase tcD = fakeTestCase( "zlonger name with spacesz", "" ); | ||||
|  | ||||
|     SECTION( "Empty test spec should have no filters" ) { | ||||
|     SECTION( "Empty test spec should have no filters", "" ) { | ||||
|         TestSpec spec; | ||||
|         CHECK( spec.hasFilters() == false ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
|         CHECK( spec.matches( tcB ) == false ); | ||||
|     } | ||||
|  | ||||
|     SECTION( "Test spec from empty string should have no filters" ) { | ||||
|     SECTION( "Test spec from empty string should have no filters", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "" ); | ||||
|         CHECK( spec.hasFilters() == false ); | ||||
|         CHECK( spec.matches(tcA ) == false ); | ||||
|         CHECK( spec.matches( tcB ) == false ); | ||||
|     } | ||||
|  | ||||
|     SECTION( "Test spec from just a comma should have no filters" ) { | ||||
|     SECTION( "Test spec from just a comma should have no filters", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "," ); | ||||
|         CHECK( spec.hasFilters() == false ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
|         CHECK( spec.matches( tcB ) == false ); | ||||
|     } | ||||
|  | ||||
|     SECTION( "Test spec from name should have one filter" ) { | ||||
|     SECTION( "Test spec from name should have one filter", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "b" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
|         CHECK( spec.matches( tcB ) == true ); | ||||
|     } | ||||
|  | ||||
|     SECTION( "Test spec from quoted name should have one filter" ) { | ||||
|     SECTION( "Test spec from quoted name should have one filter", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "\"b\"" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
|         CHECK( spec.matches( tcB ) == true ); | ||||
|     } | ||||
|  | ||||
|     SECTION( "Test spec from name should have one filter" ) { | ||||
|     SECTION( "Test spec from name should have one filter", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "b" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
| @@ -65,7 +65,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcC ) == false ); | ||||
|     } | ||||
|  | ||||
|     SECTION( "Wildcard at the start" ) { | ||||
|     SECTION( "Wildcard at the start", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "*spaces" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
| @@ -74,7 +74,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcD ) == false ); | ||||
|         CHECK( parseTestSpec( "*a" ).matches( tcA ) == true ); | ||||
|     } | ||||
|     SECTION( "Wildcard at the end" ) { | ||||
|     SECTION( "Wildcard at the end", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "long*" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
| @@ -83,7 +83,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcD ) == false ); | ||||
|         CHECK( parseTestSpec( "a*" ).matches( tcA ) == true ); | ||||
|     } | ||||
|     SECTION( "Wildcard at both ends" ) { | ||||
|     SECTION( "Wildcard at both ends", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "*name*" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
| @@ -92,25 +92,25 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcD ) == true ); | ||||
|         CHECK( parseTestSpec( "*a*" ).matches( tcA ) == true ); | ||||
|     } | ||||
|     SECTION( "Redundant wildcard at the start" ) { | ||||
|     SECTION( "Redundant wildcard at the start", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "*a" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == true ); | ||||
|         CHECK( spec.matches( tcB ) == false ); | ||||
|     } | ||||
|     SECTION( "Redundant wildcard at the end" ) { | ||||
|     SECTION( "Redundant wildcard at the end", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "a*" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == true ); | ||||
|         CHECK( spec.matches( tcB ) == false ); | ||||
|     } | ||||
|     SECTION( "Redundant wildcard at both ends" ) { | ||||
|     SECTION( "Redundant wildcard at both ends", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "*a*" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == true ); | ||||
|         CHECK( spec.matches( tcB ) == false ); | ||||
|     } | ||||
|     SECTION( "Wildcard at both ends, redundant at start" ) { | ||||
|     SECTION( "Wildcard at both ends, redundant at start", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "*longer*" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
| @@ -118,7 +118,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcC ) == true ); | ||||
|         CHECK( spec.matches( tcD ) == true ); | ||||
|     } | ||||
|     SECTION( "Just wildcard" ) { | ||||
|     SECTION( "Just wildcard", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "*" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == true ); | ||||
| @@ -127,35 +127,35 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcD ) == true ); | ||||
|     } | ||||
|  | ||||
|     SECTION( "Single tag" ) { | ||||
|     SECTION( "Single tag", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "[one]" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
|         CHECK( spec.matches( tcB ) == true ); | ||||
|         CHECK( spec.matches( tcC ) == false ); | ||||
|     } | ||||
|     SECTION( "Single tag, two matches" ) { | ||||
|     SECTION( "Single tag, two matches", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "[x]" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
|         CHECK( spec.matches( tcB ) == true ); | ||||
|         CHECK( spec.matches( tcC ) == true ); | ||||
|     } | ||||
|     SECTION( "Two tags" ) { | ||||
|     SECTION( "Two tags", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "[two][x]" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
|         CHECK( spec.matches( tcB ) == false ); | ||||
|         CHECK( spec.matches( tcC ) == true ); | ||||
|     } | ||||
|     SECTION( "Two tags, spare separated" ) { | ||||
|     SECTION( "Two tags, spare separated", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "[two] [x]" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
|         CHECK( spec.matches( tcB ) == false ); | ||||
|         CHECK( spec.matches( tcC ) == true ); | ||||
|     } | ||||
|     SECTION( "Wildcarded name and tag" ) { | ||||
|     SECTION( "Wildcarded name and tag", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "*name*[x]" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
| @@ -163,21 +163,21 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcC ) == true ); | ||||
|         CHECK( spec.matches( tcD ) == false ); | ||||
|     } | ||||
|     SECTION( "Single tag exclusion" ) { | ||||
|     SECTION( "Single tag exclusion", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "~[one]" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == true ); | ||||
|         CHECK( spec.matches( tcB ) == false ); | ||||
|         CHECK( spec.matches( tcC ) == true ); | ||||
|     } | ||||
|     SECTION( "One tag exclusion and one tag inclusion" ) { | ||||
|     SECTION( "One tag exclusion and one tag inclusion", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "~[two][x]" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
|         CHECK( spec.matches( tcB ) == true ); | ||||
|         CHECK( spec.matches( tcC ) == false ); | ||||
|     } | ||||
|     SECTION( "One tag exclusion and one wldcarded name inclusion" ) { | ||||
|     SECTION( "One tag exclusion and one wldcarded name inclusion", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "~[two]*name*" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
| @@ -185,7 +185,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcC ) == false ); | ||||
|         CHECK( spec.matches( tcD ) == true ); | ||||
|     } | ||||
|     SECTION( "One tag exclusion, using exclude:, and one wldcarded name inclusion" ) { | ||||
|     SECTION( "One tag exclusion, using exclude:, and one wldcarded name inclusion", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "exclude:[two]*name*" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
| @@ -193,7 +193,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcC ) == false ); | ||||
|         CHECK( spec.matches( tcD ) == true ); | ||||
|     } | ||||
|     SECTION( "name exclusion" ) { | ||||
|     SECTION( "name exclusion", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "~b" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == true ); | ||||
| @@ -201,7 +201,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcC ) == true ); | ||||
|         CHECK( spec.matches( tcD ) == true ); | ||||
|     } | ||||
|     SECTION( "wildcarded name exclusion" ) { | ||||
|     SECTION( "wildcarded name exclusion", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "~*name*" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == true ); | ||||
| @@ -209,7 +209,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcC ) == false ); | ||||
|         CHECK( spec.matches( tcD ) == false ); | ||||
|     } | ||||
|     SECTION( "wildcarded name exclusion with tag inclusion" ) { | ||||
|     SECTION( "wildcarded name exclusion with tag inclusion", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "~*name*,[three]" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == true ); | ||||
| @@ -217,7 +217,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcC ) == true ); | ||||
|         CHECK( spec.matches( tcD ) == false ); | ||||
|     } | ||||
|     SECTION( "wildcarded name exclusion, using exclude:, with tag inclusion" ) { | ||||
|     SECTION( "wildcarded name exclusion, using exclude:, with tag inclusion", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "exclude:*name*,[three]" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == true ); | ||||
| @@ -225,7 +225,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcC ) == true ); | ||||
|         CHECK( spec.matches( tcD ) == false ); | ||||
|     } | ||||
|     SECTION( "two wildcarded names" ) { | ||||
|     SECTION( "two wildcarded names", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "\"longer*\"\"*spaces\"" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
| @@ -233,7 +233,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcC ) == true ); | ||||
|         CHECK( spec.matches( tcD ) == false ); | ||||
|     } | ||||
|     SECTION( "empty tag" ) { | ||||
|     SECTION( "empty tag", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "[]" ); | ||||
|         CHECK( spec.hasFilters() == false ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
| @@ -241,7 +241,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcC ) == false ); | ||||
|         CHECK( spec.matches( tcD ) == false ); | ||||
|     } | ||||
|     SECTION( "empty quoted name" ) { | ||||
|     SECTION( "empty quoted name", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "\"\"" ); | ||||
|         CHECK( spec.hasFilters() == false ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
| @@ -249,7 +249,7 @@ TEST_CASE( "Parse test names and tags", "" ) { | ||||
|         CHECK( spec.matches( tcC ) == false ); | ||||
|         CHECK( spec.matches( tcD ) == false ); | ||||
|     } | ||||
|     SECTION( "quoted string followed by tag exclusion" ) { | ||||
|     SECTION( "quoted string followed by tag exclusion", "" ) { | ||||
|         TestSpec spec = parseTestSpec( "\"*name*\"~[.]" ); | ||||
|         CHECK( spec.hasFilters() == true ); | ||||
|         CHECK( spec.matches( tcA ) == false ); | ||||
|   | ||||
| @@ -15,7 +15,7 @@ namespace | ||||
| { | ||||
|     inline int thisThrows() | ||||
|     { | ||||
| 		if( Catch::isTrue( true ) ) | ||||
| 		if( Catch::alwaysTrue() ) | ||||
| 		    throw std::domain_error( "expected exception" ); | ||||
| 		return 1; | ||||
|     } | ||||
| @@ -42,14 +42,14 @@ TEST_CASE( "Expected exceptions that don't throw or unexpected exceptions fail t | ||||
|  | ||||
| TEST_CASE( "When unchecked exceptions are thrown directly they are always failures", "[.][failing]" ) | ||||
| { | ||||
| 	if( Catch::isTrue( true ) ) | ||||
| 	if( Catch::alwaysTrue() ) | ||||
| 	    throw std::domain_error( "unexpected exception" ); | ||||
| } | ||||
|  | ||||
| TEST_CASE( "An unchecked exception reports the line of the last assertion", "[.][failing]" ) | ||||
| { | ||||
|     CHECK( 1 == 1 ); | ||||
| 	if( Catch::isTrue( true ) ) | ||||
| 	if( Catch::alwaysTrue() ) | ||||
| 	    throw std::domain_error( "unexpected exception" ); | ||||
| } | ||||
|  | ||||
| @@ -57,7 +57,7 @@ TEST_CASE( "When unchecked exceptions are thrown from sections they are always f | ||||
| { | ||||
|     SECTION( "section name", "" ) | ||||
|     { | ||||
| 		if( Catch::isTrue( true ) ) | ||||
| 		if( Catch::alwaysTrue() ) | ||||
| 			throw std::domain_error( "unexpected exception" ); | ||||
|     } | ||||
| } | ||||
| @@ -118,12 +118,12 @@ CATCH_TRANSLATE_EXCEPTION( double& ex ) | ||||
|  | ||||
| TEST_CASE("Unexpected custom exceptions can be translated", "[.][failing]" ) | ||||
| { | ||||
| 	if( Catch::isTrue( true ) ) | ||||
| 	if( Catch::alwaysTrue() ) | ||||
| 	    throw CustomException( "custom exception" ); | ||||
| } | ||||
|  | ||||
| inline void throwCustom() { | ||||
| 	if( Catch::isTrue( true ) ) | ||||
| 	if( Catch::alwaysTrue() ) | ||||
| 		throw CustomException( "custom exception - not std" ); | ||||
| } | ||||
|  | ||||
| @@ -140,7 +140,7 @@ TEST_CASE( "Custom exceptions can be translated when testing for throwing as som | ||||
|  | ||||
| TEST_CASE( "Unexpected exceptions can be translated", "[.][failing]"  ) | ||||
| { | ||||
| 	if( Catch::isTrue( true ) ) | ||||
| 	if( Catch::alwaysTrue() ) | ||||
| 	    throw double( 3.14 ); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -7,6 +7,7 @@ | ||||
|  */ | ||||
|  | ||||
| #include "catch.hpp" | ||||
| #include <iostream> | ||||
|  | ||||
| #ifdef __clang__ | ||||
| #pragma clang diagnostic ignored "-Wc++98-compat-pedantic" | ||||
|   | ||||
| @@ -14,7 +14,7 @@ | ||||
|  | ||||
| #include "catch.hpp" | ||||
|  | ||||
| TEST_CASE( "section tracking" ) { | ||||
| TEST_CASE( "section tracking", "" ) { | ||||
|  | ||||
|     using namespace Catch; | ||||
|     TestCaseTracker testCaseTracker( "test case" ); | ||||
| @@ -24,7 +24,7 @@ TEST_CASE( "section tracking" ) { | ||||
|  | ||||
|     CHECK_FALSE( testCaseTracker.isCompleted() ); | ||||
|  | ||||
|     SECTION( "test case with no sections" ) { | ||||
|     SECTION( "test case with no sections", "" ) { | ||||
|  | ||||
|         { | ||||
|             TestCaseTracker::Guard guard( testCaseTracker ); | ||||
| @@ -33,7 +33,7 @@ TEST_CASE( "section tracking" ) { | ||||
|         CHECK( testCaseTracker.isCompleted() ); | ||||
|     } | ||||
|  | ||||
|     SECTION( "test case with one section" ) { | ||||
|     SECTION( "test case with one section", "" ) { | ||||
|  | ||||
|         { | ||||
|             TestCaseTracker::Guard guard( testCaseTracker ); | ||||
| @@ -58,7 +58,7 @@ TEST_CASE( "section tracking" ) { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     SECTION( "test case with two consecutive sections" ) { | ||||
|     SECTION( "test case with two consecutive sections", "" ) { | ||||
|  | ||||
|         // Enter test case | ||||
|         { | ||||
| @@ -93,7 +93,7 @@ TEST_CASE( "section tracking" ) { | ||||
|         CHECK( testCaseTracker.isCompleted() );         | ||||
|     } | ||||
|  | ||||
|     SECTION( "test case with one section within another" ) { | ||||
|     SECTION( "test case with one section within another", "" ) { | ||||
|  | ||||
|         // Enter test case again | ||||
|         { | ||||
|   | ||||
| @@ -318,19 +318,19 @@ TEST_CASE( "Assertions then sections", "[Tricky]" ) | ||||
|     // This was causing a failure due to the way the console reporter was handling | ||||
|     // the current section | ||||
|      | ||||
|     REQUIRE( Catch::isTrue( true ) ); | ||||
|     REQUIRE( Catch::alwaysTrue() ); | ||||
|      | ||||
|     SECTION( "A section", "" ) | ||||
|     { | ||||
|         REQUIRE( Catch::isTrue( true ) ); | ||||
|         REQUIRE( Catch::alwaysTrue() ); | ||||
|          | ||||
|         SECTION( "Another section", "" ) | ||||
|         { | ||||
|             REQUIRE( Catch::isTrue( true ) ); | ||||
|             REQUIRE( Catch::alwaysTrue() ); | ||||
|         } | ||||
|         SECTION( "Another other section", "" ) | ||||
|         { | ||||
|             REQUIRE( Catch::isTrue( true ) ); | ||||
|             REQUIRE( Catch::alwaysTrue() ); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -61,6 +61,8 @@ | ||||
| 		261488FD184D21290041FBEB /* catch_section_info.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_section_info.h; sourceTree = "<group>"; }; | ||||
| 		261488FE184DC32F0041FBEB /* catch_section.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_section.h; sourceTree = "<group>"; }; | ||||
| 		261488FF184DC4A20041FBEB /* catch_debugger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_debugger.h; sourceTree = "<group>"; }; | ||||
| 		2627F7051935B16F009BCE2D /* catch_result_builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = catch_result_builder.h; sourceTree = "<group>"; }; | ||||
| 		2627F7061935B55F009BCE2D /* catch_result_builder.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_result_builder.hpp; sourceTree = "<group>"; }; | ||||
| 		262E7399184673A800CAC268 /* catch_reporter_bases.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_bases.hpp; sourceTree = "<group>"; }; | ||||
| 		262E739A1846759000CAC268 /* catch_common.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_common.hpp; sourceTree = "<group>"; }; | ||||
| 		263FD06017AF8DF200988A20 /* catch_timer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_timer.hpp; sourceTree = "<group>"; }; | ||||
| @@ -104,7 +106,7 @@ | ||||
| 		4A4B0F9915CE6EC100AE2392 /* catch_interfaces_registry_hub.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = catch_interfaces_registry_hub.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; | ||||
| 		4A4B0F9A15CEF84800AE2392 /* catch_notimplemented_exception.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_notimplemented_exception.h; sourceTree = "<group>"; }; | ||||
| 		4A4B0F9B15CEF8C400AE2392 /* catch_notimplemented_exception.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_notimplemented_exception.hpp; sourceTree = "<group>"; }; | ||||
| 		4A4B0F9C15CEFA8300AE2392 /* catch_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_impl.hpp; sourceTree = "<group>"; }; | ||||
| 		4A4B0F9C15CEFA8300AE2392 /* catch_impl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_impl.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; | ||||
| 		4A6D0C20149B3D3B00DB3EAA /* CatchSelfTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = CatchSelfTest; sourceTree = BUILT_PRODUCTS_DIR; }; | ||||
| 		4A6D0C26149B3D3B00DB3EAA /* CatchSelfTest.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = CatchSelfTest.1; sourceTree = "<group>"; }; | ||||
| 		4A6D0C2D149B3D9E00DB3EAA /* ApproxTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ApproxTests.cpp; path = ../../../SelfTest/ApproxTests.cpp; sourceTree = "<group>"; }; | ||||
| @@ -169,7 +171,6 @@ | ||||
| 		4AB77CB71553B72B00857BF0 /* catch_section_info.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_section_info.hpp; sourceTree = "<group>"; }; | ||||
| 		4ABEA80415C90D2B009F0424 /* catch_objc_arc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_objc_arc.hpp; sourceTree = "<group>"; }; | ||||
| 		4AC91CCE155CF02800DC5117 /* catch_expression_lhs.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expression_lhs.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; | ||||
| 		4AC91CD0155D8DA600DC5117 /* catch_expression_decomposer.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expression_decomposer.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; | ||||
| 		4ACE21C8166CA19700FB5509 /* catch_option.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_option.hpp; sourceTree = "<group>"; }; | ||||
| 		4ACE21CA166CA1B300FB5509 /* catch_option.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_option.cpp; path = ../../../SelfTest/SurrogateCpps/catch_option.cpp; sourceTree = "<group>"; }; | ||||
| 		4AEE031F16142F910071E950 /* catch_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_common.cpp; path = ../../../SelfTest/SurrogateCpps/catch_common.cpp; sourceTree = "<group>"; }; | ||||
| @@ -342,6 +343,7 @@ | ||||
| 				4A90B59E15D2521E00EF71BC /* catch_expressionresult_builder.hpp */, | ||||
| 				4A084F1C15DACEEA0027E631 /* catch_test_case_info.hpp */, | ||||
| 				26847E5C16BBACB60043B9C1 /* catch_message.hpp */, | ||||
| 				2627F7061935B55F009BCE2D /* catch_result_builder.hpp */, | ||||
| 			); | ||||
| 			name = impl; | ||||
| 			sourceTree = "<group>"; | ||||
| @@ -361,10 +363,10 @@ | ||||
| 				4A6D0C46149B3E3D00DB3EAA /* catch_approx.hpp */, | ||||
| 				4A6D0C47149B3E3D00DB3EAA /* catch_capture.hpp */, | ||||
| 				4AC91CCE155CF02800DC5117 /* catch_expression_lhs.hpp */, | ||||
| 				4AC91CD0155D8DA600DC5117 /* catch_expression_decomposer.hpp */, | ||||
| 				4A4B0F9A15CEF84800AE2392 /* catch_notimplemented_exception.h */, | ||||
| 				26847E5B16BBAB790043B9C1 /* catch_message.h */, | ||||
| 				261488FD184D21290041FBEB /* catch_section_info.h */, | ||||
| 				2627F7051935B16F009BCE2D /* catch_result_builder.h */, | ||||
| 			); | ||||
| 			name = Assertions; | ||||
| 			sourceTree = "<group>"; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash