mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 03:43:28 +01:00
Add test for !shouldfail and failed benchmarks
This commit is contained in:
parent
7f3297f7e8
commit
1cbbc5d2cb
@ -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 ); };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user