mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Support [.] as alias for [hide]
This commit is contained in:
		| @@ -25,7 +25,7 @@ namespace Catch { | |||||||
|         bool isHidden( startsWith( _name, "./" ) ); |         bool isHidden( startsWith( _name, "./" ) ); | ||||||
|         std::set<std::string> tags; |         std::set<std::string> tags; | ||||||
|         TagExtracter( tags ).parse( desc ); |         TagExtracter( tags ).parse( desc ); | ||||||
|         if( tags.find( "hide" ) != tags.end() ) |         if( tags.find( "hide" ) != tags.end() || tags.find( "." ) != tags.end() ) | ||||||
|             isHidden = true; |             isHidden = true; | ||||||
|  |  | ||||||
|         TestCaseInfo info( _name, _className, desc, tags, isHidden, _lineInfo ); |         TestCaseInfo info( _name, _className, desc, tags, isHidden, _lineInfo ); | ||||||
|   | |||||||
| @@ -92,11 +92,11 @@ TEST_CASE( "./succeeding/nofail", "The NO_FAIL macro reports a failure but does | |||||||
|     CHECK_NOFAIL( 1 == 2 ); |     CHECK_NOFAIL( 1 == 2 ); | ||||||
| } | } | ||||||
|  |  | ||||||
| TEST_CASE( "just info", "[info][isolated info][hide]" ) | TEST_CASE( "just info", "[info][isolated info][.]" ) | ||||||
| { | { | ||||||
|     INFO( "this should never be seen" ); |     INFO( "this should never be seen" ); | ||||||
| } | } | ||||||
| TEST_CASE( "just failure", "[fail][isolated info][hide]" ) | TEST_CASE( "just failure", "[fail][isolated info][.]" ) | ||||||
| { | { | ||||||
|     FAIL( "Previous info should not be seen" ); |     FAIL( "Previous info should not be seen" ); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -272,7 +272,7 @@ TEST_CASE( "empty", "An empty test with no assertions" ) | |||||||
| { | { | ||||||
| } | } | ||||||
|  |  | ||||||
| TEST_CASE( "Nice descriptive name", "[tag1][tag2][tag3][hide]" ) | TEST_CASE( "Nice descriptive name", "[tag1][tag2][tag3][.]" ) | ||||||
| { | { | ||||||
|     WARN( "This one ran" ); |     WARN( "This one ran" ); | ||||||
| } | } | ||||||
| @@ -283,7 +283,7 @@ TEST_CASE( "second tag", "[tag2]" ) | |||||||
| { | { | ||||||
| } | } | ||||||
| // | // | ||||||
| //TEST_CASE( "spawn a new process", "[hide]" ) | //TEST_CASE( "spawn a new process", "[.]" ) | ||||||
| //{ | //{ | ||||||
| //    // !TBD Work in progress | //    // !TBD Work in progress | ||||||
| //    char line[200]; | //    char line[200]; | ||||||
|   | |||||||
| @@ -305,7 +305,7 @@ TEST_CASE( "selftest/tags", "" ) { | |||||||
|     std::string p2 = "[one],[two]"; |     std::string p2 = "[one],[two]"; | ||||||
|     std::string p3 = "[one][two]"; |     std::string p3 = "[one][two]"; | ||||||
|     std::string p4 = "[one][two],[three]"; |     std::string p4 = "[one][two],[three]"; | ||||||
|     std::string p5 = "[one][two]~[hide],[three]"; |     std::string p5 = "[one][two]~[.],[three]"; | ||||||
|      |      | ||||||
|     SECTION( "one tag", "" ) { |     SECTION( "one tag", "" ) { | ||||||
|         Catch::TestCase oneTag = makeTestCase( NULL, "", "test", "[one]", CATCH_INTERNAL_LINEINFO ); |         Catch::TestCase oneTag = makeTestCase( NULL, "", "test", "[one]", CATCH_INTERNAL_LINEINFO ); | ||||||
| @@ -357,13 +357,13 @@ TEST_CASE( "selftest/tags", "" ) { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     SECTION( "hidden", "" ) { |     SECTION( "hidden", "" ) { | ||||||
|         Catch::TestCase oneTag = makeTestCase( NULL, "", "test", "[hide]", CATCH_INTERNAL_LINEINFO ); |         Catch::TestCase oneTag = makeTestCase( NULL, "", "test", "[.]", CATCH_INTERNAL_LINEINFO ); | ||||||
|  |  | ||||||
|         CHECK( oneTag.getTestCaseInfo().description == "" ); |         CHECK( oneTag.getTestCaseInfo().description == "" ); | ||||||
|         CHECK( oneTag.hasTag( "hide" ) ); |         CHECK( oneTag.hasTag( "." ) ); | ||||||
|         CHECK( oneTag.isHidden() ); |         CHECK( oneTag.isHidden() ); | ||||||
|  |  | ||||||
|         CHECK( oneTag.matchesTags( "~[hide]" ) == false ); |         CHECK( oneTag.matchesTags( "~[.]" ) == false ); | ||||||
|  |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash