mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 13:25:41 +02:00
Allow CATCH_CONFIG_DEFAULT_REPORTER to be arbitrary reporter spec
Previously it could be just plain reporter name, e.g. `xml`, but it could not specify other reporter options. This change is not particularly useful for the built-in reporters, as it mostly comes in handy for combining specific custom reporter with custom arguments, and the built-in reporters do not have those.
This commit is contained in:
@@ -107,14 +107,16 @@ namespace Catch {
|
||||
|
||||
// Insert the default reporter if user hasn't asked for a specific one
|
||||
if ( m_data.reporterSpecifications.empty() ) {
|
||||
m_data.reporterSpecifications.push_back( {
|
||||
#if defined( CATCH_CONFIG_DEFAULT_REPORTER )
|
||||
CATCH_CONFIG_DEFAULT_REPORTER,
|
||||
const auto default_spec = CATCH_CONFIG_DEFAULT_REPORTER;
|
||||
#else
|
||||
"console",
|
||||
const auto default_spec = "console";
|
||||
#endif
|
||||
{}, {}, {}
|
||||
} );
|
||||
auto parsed = parseReporterSpec(default_spec);
|
||||
CATCH_ENFORCE( parsed,
|
||||
"Cannot parse the provided default reporter spec: '"
|
||||
<< default_spec << '\'' );
|
||||
m_data.reporterSpecifications.push_back( std::move( *parsed ) );
|
||||
}
|
||||
|
||||
if ( enableBazelEnvSupport() ) {
|
||||
|
Reference in New Issue
Block a user