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-09-26 18:38:26 +0100
committerPhil Nash2012-09-26 18:38:26 +0100
commit67ec8709eae23dfb4fe30f789fd788d5a9c77ea8 (patch)
tree0496f11a509751107992137a18456bda9f111e55 /projects/SelfTest/TestMain.cpp
parentc4160e9ef81acb9ebfb1e3acd2d81487b49b2360 (diff)
downloadcatch3-67ec8709eae23dfb4fe30f789fd788d5a9c77ea8.tar.gz
First cut of command line support for tags
Diffstat (limited to 'projects/SelfTest/TestMain.cpp')
-rw-r--r--projects/SelfTest/TestMain.cpp33
1 files changed, 28 insertions, 5 deletions
diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp
index 2c0c2514..b0fe11f5 100644
--- a/projects/SelfTest/TestMain.cpp
+++ b/projects/SelfTest/TestMain.cpp
@@ -247,8 +247,31 @@ TEST_CASE( "selftest/parser/2", "ConfigData" ) {
REQUIRE( config.allowThrows == false );
}
-
}
+
+ SECTION( "streams", "" ) {
+ SECTION( "-o filename", "" ) {
+ const char* argv[] = { "test", "-o", "filename.ext" };
+ CHECK_NOTHROW( parseIntoConfig( argv, config ) );
+
+ REQUIRE( config.outputFilename == "filename.ext" );
+ REQUIRE( config.stream.empty() );
+ }
+ SECTION( "-o %stdout", "" ) {
+ const char* argv[] = { "test", "-o", "%stdout" };
+ CHECK_NOTHROW( parseIntoConfig( argv, config ) );
+
+ REQUIRE( config.stream == "stdout" );
+ REQUIRE( config.outputFilename.empty() );
+ }
+ SECTION( "--out", "" ) {
+ const char* argv[] = { "test", "--out", "filename.ext" };
+ CHECK_NOTHROW( parseIntoConfig( argv, config ) );
+
+ REQUIRE( config.outputFilename == "filename.ext" );
+ }
+ }
+
SECTION( "combinations", "" ) {
SECTION( "-a -b", "" ) {
const char* argv[] = { "test", "-a", "-b", "-nt" };
@@ -345,7 +368,7 @@ TEST_CASE( "selftest/tags", "" ) {
CHECK( oneTag.getDescription() == "" );
CHECK( oneTag.hasTag( "one" ) );
- CHECK( oneTag.tags().size() == 1 );
+ CHECK( oneTag.getTags().size() == 1 );
CHECK( oneTag.matchesTags( p1 ) == true );
CHECK( oneTag.matchesTags( p2 ) == true );
@@ -361,7 +384,7 @@ TEST_CASE( "selftest/tags", "" ) {
CHECK( twoTags.hasTag( "one" ) );
CHECK( twoTags.hasTag( "two" ) );
CHECK( twoTags.hasTag( "three" ) == false );
- CHECK( twoTags.tags().size() == 2 );
+ CHECK( twoTags.getTags().size() == 2 );
CHECK( twoTags.matchesTags( p1 ) == true );
CHECK( twoTags.matchesTags( p2 ) == true );
@@ -376,7 +399,7 @@ TEST_CASE( "selftest/tags", "" ) {
CHECK( oneTagWithExtras.getDescription() == "1234" );
CHECK( oneTagWithExtras.hasTag( "one" ) );
CHECK( oneTagWithExtras.hasTag( "two" ) == false );
- CHECK( oneTagWithExtras.tags().size() == 1 );
+ CHECK( oneTagWithExtras.getTags().size() == 1 );
}
SECTION( "start of a tag, but not closed", "" ) {
@@ -385,7 +408,7 @@ TEST_CASE( "selftest/tags", "" ) {
CHECK( oneTagOpen.getDescription() == "[one" );
CHECK( oneTagOpen.hasTag( "one" ) == false );
- CHECK( oneTagOpen.tags().size() == 0 );
+ CHECK( oneTagOpen.getTags().size() == 0 );
}
SECTION( "hidden", "" ) {