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-30 23:50:40 +0100
committerMartin Hořeňovský2022-01-01 14:16:11 +0100
commitfae0be25b3e1bdd07a18465749488650616d78f9 (patch)
treef0fd7d41d82bac9ee38f095cab0193f35ec13ace /tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
parent899554bff2ba64afa7a20e1796b85d396cbbfd8d (diff)
downloadcatch3-fae0be25b3e1bdd07a18465749488650616d78f9.tar.gz
Improve error handling in parsing reporter specs
Diffstat (limited to 'tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp')
-rw-r--r--tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
index 2210a3a4..53fc08b8 100644
--- a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
@@ -682,3 +682,20 @@ TEST_CASE("Test with special, characters \"in name", "[cli][regression]") {
// This test case succeeds if we can invoke it from the CLI
SUCCEED();
}
+
+TEST_CASE("Various suspicious reporter specs are rejected",
+ "[cli][reporter-spec][approvals]") {
+ Catch::ConfigData config;
+ auto cli = Catch::makeCommandLineParser( config );
+
+ auto spec = GENERATE( as<std::string>{},
+ "",
+ "::console",
+ "console::",
+ "console::some-file::",
+ "::console::some-file::" );
+ CAPTURE( spec );
+
+ auto result = cli.parse( { "test", "--reporter", spec } );
+ REQUIRE_FALSE( result );
+}