mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-28 07:29:25 +00:00
Added nothrow command line option
Causes _THROWS family of macros to no evaluate expression
This commit is contained in:
parent
e20b252b5a
commit
46a3476731
9 changed files with 107 additions and 32 deletions
|
@ -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( "combinations", "" ) {
|
||||
SECTION( "-a -b", "" ) {
|
||||
const char* argv[] = { "test", "-a", "-b" };
|
||||
|
||||
SECTION( "nothrow", "" ) {
|
||||
SECTION( "-nt", "" ) {
|
||||
const char* argv[] = { "test", "-nt" };
|
||||
Catch::Config config;
|
||||
CHECK( parseIntoConfig( argv, config ) );
|
||||
|
||||
REQUIRE( config.getCutoff() == 1 );
|
||||
REQUIRE( config.shouldDebugBreak() );
|
||||
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", "-nt" };
|
||||
Catch::Config config;
|
||||
CHECK( parseIntoConfig( argv, config ) );
|
||||
|
||||
CHECK( config.getCutoff() == 1 );
|
||||
CHECK( config.shouldDebugBreak() );
|
||||
CHECK( config.allowThrows() == false );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue