diff options
| author | Phil Nash | 2017-03-13 11:00:58 +0000 |
|---|---|---|
| committer | Phil Nash | 2017-03-13 11:00:58 +0000 |
| commit | 38b05f140003811f15345ec498b15b0e882e562e (patch) | |
| tree | 2cedc82fd83d2509116ba957e936de4fb1f445b4 /projects/SelfTest/TestMain.cpp | |
| parent | db9866677ebea77fd065248135f084139304a06c (diff) | |
| download | catch3-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.cpp | 8 |
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 ); |