mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-30 19:57:10 +01:00 
			
		
		
		
	Add test for !shouldfail and failed benchmarks
This commit is contained in:
		| @@ -359,6 +359,16 @@ set_tests_properties("Benchmarking::FailureReporting::FailMacro" | ||||
|     FAIL_REGULAR_EXPRESSION "successes=\"1\"" | ||||
| ) | ||||
|  | ||||
| add_test(NAME "Benchmarking::FailureReporting::ShouldFailIsRespected" | ||||
|   COMMAND | ||||
|     $<TARGET_FILE:SelfTest> "Failing benchmark respects should-fail" | ||||
| ) | ||||
| set_tests_properties("Benchmarking::FailureReporting::ShouldFailIsRespected" | ||||
|   PROPERTIES | ||||
|     PASS_REGULAR_EXPRESSION "1 failed as expected" | ||||
| ) | ||||
|  | ||||
|  | ||||
| if (CATCH_USE_VALGRIND) | ||||
|     add_test(NAME ValgrindRunTests COMMAND valgrind --leak-check=full --error-exitcode=1 $<TARGET_FILE:SelfTest>) | ||||
|     add_test(NAME ValgrindListTests COMMAND valgrind --leak-check=full --error-exitcode=1 $<TARGET_FILE:SelfTest> --list-tests --verbosity high) | ||||
|   | ||||
| @@ -433,3 +433,8 @@ TEST_CASE("Failing benchmarks", "[!benchmark][.approvals]") { | ||||
|         }; | ||||
|     } | ||||
| } | ||||
|  | ||||
| TEST_CASE( "Failing benchmark respects should-fail", | ||||
|            "[!shouldfail][!benchmark][.approvals]" ) { | ||||
|     BENCHMARK( "Asserting benchmark" ) { REQUIRE( 1 == 2 ); }; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský