Implement warning for unmatched test specs

This commit is contained in:
Martin Hořeňovský
2021-12-18 19:59:23 +01:00
parent 9f2dca5384
commit 840acedf62
8 changed files with 54 additions and 6 deletions

View File

@@ -229,6 +229,23 @@ add_test(NAME TestSpecs::OverrideFailureWithNoMatchedTests
COMMAND $<TARGET_FILE:SelfTest> "___nonexistent_test___" --allow-running-no-tests
)
add_test(NAME Warnings::UnmatchedTestSpecIsAccepted
COMMAND $<TARGET_FILE:SelfTest> Tracker --warn UnmatchedTestSpec
)
set_tests_properties(Warnings::UnmatchedTestSpecIsAccepted
PROPERTIES
FAIL_REGULAR_EXPRESSION "Unrecognised warning option: "
)
add_test(NAME TestSpecs::WarnUnmatchedTestSpecFailsWithUnmatchedTestSpec
COMMAND
$<TARGET_FILE:SelfTest> Tracker, "___nonexistent_test___" --warn UnmatchedTestSpec
)
set_tests_properties(TestSpecs::WarnUnmatchedTestSpecFailsWithUnmatchedTestSpec
PROPERTIES
WILL_FAIL ON
)
add_test(NAME UnmatchedOutputFilter COMMAND $<TARGET_FILE:SelfTest> [this-tag-does-not-exist])
set_tests_properties(UnmatchedOutputFilter
PROPERTIES