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

summaryrefslogtreecommitdiffhomepage
path: root/projects/SelfTest/TestMain.cpp
diff options
context:
space:
mode:
authorPhil Nash2012-06-05 20:50:47 +0100
committerPhil Nash2012-06-05 20:50:47 +0100
commit46a3476731b7e8f2a3a413572785bd207c063acf (patch)
tree5246b24f160ef726a0f781129bbfa4b865287fda /projects/SelfTest/TestMain.cpp
parente20b252b5ae5b0faf9568084fd401e6accddc460 (diff)
downloadcatch3-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.cpp26
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 );
}
}