Support for multiple reporters

- can't (yet) specify different targets for each reporter (e.g. different files)
This commit is contained in:
Phil Nash
2015-08-05 19:02:17 +01:00
parent c06e1909ae
commit 4cb74761d9
11 changed files with 205 additions and 19 deletions

View File

@@ -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" );
}
}