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

summaryrefslogtreecommitdiffhomepage
path: root/projects/SelfTest/TestMain.cpp
diff options
context:
space:
mode:
authorPhil Nash2017-03-13 11:00:58 +0000
committerPhil Nash2017-03-13 11:00:58 +0000
commit38b05f140003811f15345ec498b15b0e882e562e (patch)
tree2cedc82fd83d2509116ba957e936de4fb1f445b4 /projects/SelfTest/TestMain.cpp
parentdb9866677ebea77fd065248135f084139304a06c (diff)
downloadcatch3-38b05f140003811f15345ec498b15b0e882e562e.tar.gz
Don’t assume first CL arg (exe name) is present
Fixes #729
Diffstat (limited to 'projects/SelfTest/TestMain.cpp')
-rw-r--r--projects/SelfTest/TestMain.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp
index e00966a8..e03a9e44 100644
--- a/projects/SelfTest/TestMain.cpp
+++ b/projects/SelfTest/TestMain.cpp
@@ -51,10 +51,18 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
Catch::ConfigData config;
+ SECTION( "empty args don't cause a crash" ) {
+ Catch::Clara::CommandLine<Catch::ConfigData> parser = Catch::makeCommandLineParser();
+ CHECK_NOTHROW( parser.parseInto( std::vector<std::string>(), config ) );
+
+ CHECK( config.processName == "" );
+ }
+
SECTION( "default - no arguments", "" ) {
const char* argv[] = { "test" };
CHECK_NOTHROW( parseIntoConfig( argv, config ) );
+ CHECK( config.processName == "test" );
CHECK( config.shouldDebugBreak == false );
CHECK( config.abortAfter == -1 );
CHECK( config.noThrow == false );