Skip to content

Commit

Permalink
--allow-running-no-tests also allows all tests to be skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Jan 5, 2023
1 parent 5691f74 commit a411826
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/catch2/catch_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ namespace Catch {
}

if ( totals.testCases.total() > 0 &&
totals.testCases.total() == totals.testCases.skipped ) {
totals.testCases.total() == totals.testCases.skipped
&& !m_config->zeroTestsCountAsSuccess() ) {
return 4;
}

Expand Down
4 changes: 4 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ add_test(NAME TestSpecs::OverrideFailureWithNoMatchedTests
COMMAND $<TARGET_FILE:SelfTest> "___nonexistent_test___" --allow-running-no-tests
)

add_test(NAME TestSpecs::OverrideAllSkipFailure
COMMAND $<TARGET_FILE:SelfTest> "tests can be skipped dynamically at runtime" --allow-running-no-tests
)

add_test(NAME TestSpecs::NonMatchingTestSpecIsRoundTrippable
COMMAND $<TARGET_FILE:SelfTest> Tracker, "this test does not exist" "[nor does this tag]"
)
Expand Down

0 comments on commit a411826

Please sign in to comment.