diff options
| author | Phil Nash | 2012-06-05 20:50:47 +0100 |
|---|---|---|
| committer | Phil Nash | 2012-06-05 20:50:47 +0100 |
| commit | 46a3476731b7e8f2a3a413572785bd207c063acf (patch) | |
| tree | 5246b24f160ef726a0f781129bbfa4b865287fda /projects/SelfTest/TestMain.cpp | |
| parent | e20b252b5ae5b0faf9568084fd401e6accddc460 (diff) | |
| download | catch3-46a3476731b7e8f2a3a413572785bd207c063acf.tar.gz | |
Added nothrow command line option
Causes _THROWS family of macros to no evaluate expression
Diffstat (limited to 'projects/SelfTest/TestMain.cpp')
| -rw-r--r-- | projects/SelfTest/TestMain.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 093005be..23691b55 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -75,6 +75,7 @@ TEST_CASE( "selftest/parser", "" ) { CHECK( config.shouldDebugBreak() == false ); CHECK( config.showHelp() == false ); CHECK( config.getCutoff() == -1 ); + CHECK( config.allowThrows() == true ); CHECK( dynamic_cast<Catch::BasicReporter*>( config.getReporter().get() ) ); } @@ -225,14 +226,33 @@ TEST_CASE( "selftest/parser", "" ) { REQUIRE_THAT( config.getMessage(), Contains( "accepts" ) ); } } + + SECTION( "nothrow", "" ) { + SECTION( "-nt", "" ) { + const char* argv[] = { "test", "-nt" }; + Catch::Config config; + CHECK( parseIntoConfig( argv, config ) ); + + REQUIRE( config.allowThrows() == false ); + } + SECTION( "--nothrow", "" ) { + const char* argv[] = { "test", "--nothrow" }; + Catch::Config config; + CHECK( parseIntoConfig( argv, config ) ); + + REQUIRE( config.allowThrows() == false ); + } + + } SECTION( "combinations", "" ) { SECTION( "-a -b", "" ) { - const char* argv[] = { "test", "-a", "-b" }; + const char* argv[] = { "test", "-a", "-b", "-nt" }; Catch::Config config; CHECK( parseIntoConfig( argv, config ) ); - REQUIRE( config.getCutoff() == 1 ); - REQUIRE( config.shouldDebugBreak() ); + CHECK( config.getCutoff() == 1 ); + CHECK( config.shouldDebugBreak() ); + CHECK( config.allowThrows() == false ); } } |