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

View File

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