Allow enabling multiple warnings in one invocation

This commit is contained in:
Martin Hořeňovský 2021-12-18 20:48:43 +01:00
parent 840acedf62
commit 3cc0c033e4
No known key found for this signature in database
GPG key ID: DE48307B8B0D381A
14 changed files with 165 additions and 11 deletions

View file

@ -618,6 +618,28 @@ TEST_CASE("Parsing sharding-related cli flags", "[sharding]") {
}
TEST_CASE( "Parsing warnings", "[cli][warnings]" ) {
using Catch::WarnAbout;
Catch::ConfigData config;
auto cli = Catch::makeCommandLineParser( config );
SECTION( "NoAssertions" ) {
REQUIRE(cli.parse( { "test", "-w", "NoAssertions" } ));
REQUIRE( config.warnings == WarnAbout::NoAssertions );
}
SECTION( "NoTests is no longer supported" ) {
REQUIRE_FALSE(cli.parse( { "test", "-w", "NoTests" } ));
}
SECTION( "Combining multiple warnings" ) {
REQUIRE( cli.parse( { "test",
"--warn", "NoAssertions",
"--warn", "UnmatchedTestSpec" } ) );
REQUIRE( config.warnings == ( WarnAbout::NoAssertions | WarnAbout::UnmatchedTestSpec ) );
}
}
TEST_CASE("Test with special, characters \"in name", "[cli][regression]") {
// This test case succeeds if we can invoke it from the CLI
SUCCEED();