Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_commandline.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-02-17 20:44:27 +0100
committerMartin Hořeňovský2022-02-17 23:02:30 +0100
commitfc5552d27b57628f8faf6064ca6b305e2d3bf458 (patch)
treee1ffae9f5e92ad3eb31ad544c06b0e1e639c4d98 /src/catch2/internal/catch_commandline.cpp
parent7cf2f88e50f0d1de324489c31db0314188423b6d (diff)
downloadcatch3-fc5552d27b57628f8faf6064ca6b305e2d3bf458.tar.gz
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.
Diffstat (limited to 'src/catch2/internal/catch_commandline.cpp')
-rw-r--r--src/catch2/internal/catch_commandline.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/catch2/internal/catch_commandline.cpp b/src/catch2/internal/catch_commandline.cpp
index dd7b9f6c..ca1af626 100644
--- a/src/catch2/internal/catch_commandline.cpp
+++ b/src/catch2/internal/catch_commandline.cpp
@@ -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() )