Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-12-18 20:48:43 +0100
committerMartin Hořeňovský2021-12-18 20:50:05 +0100
commit3cc0c033e4c359dfea006b749416a0cd3a322c1c (patch)
tree34181026aef41ade6f4662893bc2268a928b7bd6 /tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
parent840acedf62b2dabb98bf4ab372a7582131d6b530 (diff)
downloadcatch3-3cc0c033e4c359dfea006b749416a0cd3a322c1c.tar.gz
Allow enabling multiple warnings in one invocation
Diffstat (limited to 'tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp')
-rw-r--r--tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
index 332cbe50..16a77bc1 100644
--- a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
@@ -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();