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

summaryrefslogtreecommitdiffhomepage
path: root/projects/SelfTest/TestMain.cpp
diff options
context:
space:
mode:
authorPhil Nash2015-08-05 19:02:17 +0100
committerPhil Nash2015-08-05 19:02:17 +0100
commit4cb74761d990be2fa65266c3e1d659a481493735 (patch)
treeada9a6f5f4a1aada6a260715b4c9947639cad695 /projects/SelfTest/TestMain.cpp
parentc06e1909aecc5d628151446c84c7978eb5e8ce3e (diff)
downloadcatch3-4cb74761d990be2fa65266c3e1d659a481493735.tar.gz
Support for multiple reporters
- can't (yet) specify different targets for each reporter (e.g. different files)
Diffstat (limited to 'projects/SelfTest/TestMain.cpp')
-rw-r--r--projects/SelfTest/TestMain.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp
index bb2cf417..57e68666 100644
--- a/projects/SelfTest/TestMain.cpp
+++ b/projects/SelfTest/TestMain.cpp
@@ -53,7 +53,7 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
CHECK( config.shouldDebugBreak == false );
CHECK( config.abortAfter == -1 );
CHECK( config.noThrow == false );
- CHECK( config.reporterName.empty() );
+ CHECK( config.reporterNames.empty() );
}
SECTION( "test lists", "" ) {
@@ -90,19 +90,27 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
const char* argv[] = { "test", "-r", "console" };
CHECK_NOTHROW( parseIntoConfig( argv, config ) );
- REQUIRE( config.reporterName == "console" );
+ REQUIRE( config.reporterNames[0] == "console" );
}
SECTION( "-r/xml", "" ) {
const char* argv[] = { "test", "-r", "xml" };
CHECK_NOTHROW( parseIntoConfig( argv, config ) );
- REQUIRE( config.reporterName == "xml" );
+ REQUIRE( config.reporterNames[0] == "xml" );
+ }
+ SECTION( "-r xml and junit", "" ) {
+ const char* argv[] = { "test", "-r", "xml", "-r", "junit" };
+ CHECK_NOTHROW( parseIntoConfig( argv, config ) );
+
+ REQUIRE( config.reporterNames.size() == 2 );
+ REQUIRE( config.reporterNames[0] == "xml" );
+ REQUIRE( config.reporterNames[1] == "junit" );
}
SECTION( "--reporter/junit", "" ) {
const char* argv[] = { "test", "--reporter", "junit" };
CHECK_NOTHROW( parseIntoConfig( argv, config ) );
- REQUIRE( config.reporterName == "junit" );
+ REQUIRE( config.reporterNames[0] == "junit" );
}
}