Allow specifying default reporter at compile time

This commit is contained in:
Martin Hořeňovský 2017-08-10 16:24:31 +02:00
parent 11295a2663
commit 5da76bb7be
1 changed files with 5 additions and 1 deletions

View File

@ -32,10 +32,14 @@ namespace Catch {
return reporter;
}
#ifndef CATCH_CONFIG_DEFAULT_REPORTER
#define CATCH_CONFIG_DEFAULT_REPORTER "console"
#endif
IStreamingReporterPtr makeReporter( std::shared_ptr<Config> const& config ) {
auto const& reporterNames = config->getReporterNames();
if( reporterNames.empty() )
return createReporter( "console", config );
return createReporter(CATCH_CONFIG_DEFAULT_REPORTER, config );
IStreamingReporterPtr reporter;
for( auto const& name : reporterNames )