mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-31 08:57:58 +00:00
Push down handling of default reporter to Config's constructor
This simplifies the handling of default reporter in console parsing, at the cost of making `Config`'s constructor responsible for more things.
This commit is contained in:
parent
7cf2f88e50
commit
fc5552d27b
15 changed files with 132 additions and 54 deletions
|
@ -139,15 +139,6 @@ namespace Catch {
|
|||
return ParserResult::runtimeError( "Received empty reporter spec." );
|
||||
}
|
||||
|
||||
IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
|
||||
|
||||
// clear the default reporter
|
||||
if (!config._nonDefaultReporterSpecifications) {
|
||||
config.reporterSpecifications.clear();
|
||||
config._nonDefaultReporterSpecifications = true;
|
||||
}
|
||||
|
||||
|
||||
// Exactly one of the reporters may be specified without an output
|
||||
// file, in which case it defaults to the output specified by "-o"
|
||||
// (or standard output).
|
||||
|
@ -176,6 +167,8 @@ namespace Catch {
|
|||
fileNameSeparatorPos + separatorSize, reporterSpec.size() );
|
||||
}
|
||||
|
||||
IReporterRegistry::FactoryMap const& factories =
|
||||
getRegistryHub().getReporterRegistry().getFactories();
|
||||
auto result = factories.find( reporterName );
|
||||
|
||||
if( result == factories.end() )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue