Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

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.
Commit
fc5552d27b57628f8faf6064ca6b305e2d3bf458
Author
Martin Hořeňovský ·
Parents
7cf2f88e50f0

Files · Download .tar.gz

Changes

 src/catch2/catch_config.cpp                        | 15 ++++++++++++
 src/catch2/catch_config.hpp                        | 10 +-------
 src/catch2/internal/catch_commandline.cpp          | 11 ++-------
 tests/SelfTest/Baselines/compact.sw.approved.txt   |  8 ++++---
 .../Baselines/compact.sw.multi.approved.txt        |  8 ++++---
 tests/SelfTest/Baselines/console.std.approved.txt  |  2 +-
 tests/SelfTest/Baselines/console.sw.approved.txt   | 20 ++++++++++++----
 .../Baselines/console.sw.multi.approved.txt        | 20 ++++++++++++----
 tests/SelfTest/Baselines/junit.sw.approved.txt     |  2 +-
 .../SelfTest/Baselines/junit.sw.multi.approved.txt |  2 +-
 tests/SelfTest/Baselines/tap.sw.approved.txt       |  8 +++++--
 tests/SelfTest/Baselines/tap.sw.multi.approved.txt |  8 +++++--
 tests/SelfTest/Baselines/xml.sw.approved.txt       | 28 +++++++++++++++++-----
 tests/SelfTest/Baselines/xml.sw.multi.approved.txt | 28 +++++++++++++++++-----
 .../SelfTest/IntrospectiveTests/CmdLine.tests.cpp  | 16 ++++++++++++-
 15 files changed, 132 insertions(+), 54 deletions(-)

diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp
index c507b1b6..e6a5b2ed 100644
--- a/src/catch2/catch_config.cpp
+++ b/src/catch2/catch_config.cpp
@@ -6,6 +6,7 @@
 
 // SPDX-License-Identifier: BSL-1.0
 #include <catch2/catch_config.hpp>
+#include <catch2/catch_user_config.hpp>
 #include <catch2/internal/catch_enforce.hpp>
 #include <catch2/internal/catch_stream.hpp>
 #include <catch2/internal/catch_stringref.hpp>
@@ -57,6 +58,7 @@ namespace Catch {
             elem = trim(elem);
         }
 
+
         TestSpecParser parser(ITagAliasRegistry::get());
         if (!m_data.testsOrTags.empty()) {
             m_hasTestFilters = true;
@@ -66,6 +68,19 @@ namespace Catch {
         }
         m_testSpec = parser.testSpec();
 
+
+        // Insert the default reporter if user hasn't asked for a specfic one
+        if ( m_data.reporterSpecifications.empty() ) {
+            m_data.reporterSpecifications.push_back( {
+#if defined( CATCH_CONFIG_DEFAULT_REPORTER )
+                CATCH_CONFIG_DEFAULT_REPORTER,
+#else
+                "console",
+#endif
+                {}
+            } );
+        }
+
         m_reporterStreams.reserve( m_data.reporterSpecifications.size() );
         for ( auto const& reporterAndFile : m_data.reporterSpecifications ) {
             if ( reporterAndFile.outputFileName.none() ) {
diff --git a/src/catch2/catch_config.hpp b/src/catch2/catch_config.hpp
index 1aaa9828..a8cdc48a 100644
--- a/src/catch2/catch_config.hpp
+++ b/src/catch2/catch_config.hpp
@@ -71,15 +71,7 @@ namespace Catch {
         std::string defaultOutputFilename;
         std::string name;
         std::string processName;
-#ifndef CATCH_CONFIG_DEFAULT_REPORTER
-#define CATCH_CONFIG_DEFAULT_REPORTER "console"
-#endif
-        std::vector<ReporterAndFile> reporterSpecifications = {
-            {CATCH_CONFIG_DEFAULT_REPORTER, {}}
-        };
-        // Internal: used as parser state
-        bool _nonDefaultReporterSpecifications = false;
-#undef CATCH_CONFIG_DEFAULT_REPORTER
+        std::vector<ReporterAndFile> reporterSpecifications;
 
         std::vector<std::string> testsOrTags;
         std::vector<std::string> sectionsToRun;
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() )
diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt
index 20098061..87e318dd 100644
--- a/tests/SelfTest/Baselines/compact.sw.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.approved.txt
@@ -1267,10 +1267,12 @@ CmdLine.tests.cpp:<line number>: passed: config.processName == "test" for: "test
 CmdLine.tests.cpp:<line number>: passed: config.shouldDebugBreak == false for: false == false
 CmdLine.tests.cpp:<line number>: passed: config.abortAfter == -1 for: -1 == -1
 CmdLine.tests.cpp:<line number>: passed: config.noThrow == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == std::vector<Catch::ConfigData::ReporterAndFile>{ {"console", {}} } for: { { console, <default-output> } }
-==
-{ { console, <default-output> } }
+CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications.empty() for: true
 CmdLine.tests.cpp:<line number>: passed: !(cfg.hasTestFilters()) for: !false
+CmdLine.tests.cpp:<line number>: passed: cfg.getReportersAndOutputFiles().size() == 1 for: 1 == 1
+CmdLine.tests.cpp:<line number>: passed: cfg.getReportersAndOutputFiles()[0] == Catch::ConfigData::ReporterAndFile{ expectedReporter, {} } for: { console, <default-output> }
+==
+{ console, <default-output> }
 CmdLine.tests.cpp:<line number>: passed: result for: {?}
 CmdLine.tests.cpp:<line number>: passed: cfg.hasTestFilters() for: true
 CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(*fakeTestCase("notIncluded")) == false for: false == false
diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
index 993a7b7c..6c7c1baf 100644
--- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
@@ -1265,10 +1265,12 @@ CmdLine.tests.cpp:<line number>: passed: config.processName == "test" for: "test
 CmdLine.tests.cpp:<line number>: passed: config.shouldDebugBreak == false for: false == false
 CmdLine.tests.cpp:<line number>: passed: config.abortAfter == -1 for: -1 == -1
 CmdLine.tests.cpp:<line number>: passed: config.noThrow == false for: false == false
-CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications == std::vector<Catch::ConfigData::ReporterAndFile>{ {"console", {}} } for: { { console, <default-output> } }
-==
-{ { console, <default-output> } }
+CmdLine.tests.cpp:<line number>: passed: config.reporterSpecifications.empty() for: true
 CmdLine.tests.cpp:<line number>: passed: !(cfg.hasTestFilters()) for: !false
+CmdLine.tests.cpp:<line number>: passed: cfg.getReportersAndOutputFiles().size() == 1 for: 1 == 1
+CmdLine.tests.cpp:<line number>: passed: cfg.getReportersAndOutputFiles()[0] == Catch::ConfigData::ReporterAndFile{ expectedReporter, {} } for: { console, <default-output> }
+==
+{ console, <default-output> }
 CmdLine.tests.cpp:<line number>: passed: result for: {?}
 CmdLine.tests.cpp:<line number>: passed: cfg.hasTestFilters() for: true
 CmdLine.tests.cpp:<line number>: passed: cfg.testSpec().matches(*fakeTestCase("notIncluded")) == false for: false == false
diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt
index f6f6b292..195e0ccb 100644
--- a/tests/SelfTest/Baselines/console.std.approved.txt
+++ b/tests/SelfTest/Baselines/console.std.approved.txt
@@ -1396,5 +1396,5 @@ due to unexpected exception with message:
 
 ===============================================================================
 test cases:  381 |  305 passed |  69 failed |  7 failed as expected
-assertions: 2209 | 2054 passed | 128 failed | 27 failed as expected
+assertions: 2211 | 2056 passed | 128 failed | 27 failed as expected
 
diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt
index 8d1a25b4..d2d8a04f 100644
--- a/tests/SelfTest/Baselines/console.sw.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.approved.txt
@@ -9260,17 +9260,27 @@ with expansion:
   false == false
 
 CmdLine.tests.cpp:<line number>: PASSED:
-  CHECK( config.reporterSpecifications == std::vector<Catch::ConfigData::ReporterAndFile>{ {"console", {}} } )
+  CHECK( config.reporterSpecifications.empty() )
 with expansion:
-  { { console, <default-output> } }
-  ==
-  { { console, <default-output> } }
+  true
 
 CmdLine.tests.cpp:<line number>: PASSED:
   CHECK_FALSE( cfg.hasTestFilters() )
 with expansion:
   !false
 
+CmdLine.tests.cpp:<line number>: PASSED:
+  CHECK( cfg.getReportersAndOutputFiles().size() == 1 )
+with expansion:
+  1 == 1
+
+CmdLine.tests.cpp:<line number>: PASSED:
+  CHECK( cfg.getReportersAndOutputFiles()[0] == Catch::ConfigData::ReporterAndFile{ expectedReporter, {} } )
+with expansion:
+  { console, <default-output> }
+  ==
+  { console, <default-output> }
+
 -------------------------------------------------------------------------------
 Process can be configured on command line
   test lists
@@ -17755,5 +17765,5 @@ Misc.tests.cpp:<line number>: PASSED:
 
 ===============================================================================
 test cases:  381 |  291 passed |  83 failed |  7 failed as expected
-assertions: 2224 | 2054 passed | 143 failed | 27 failed as expected
+assertions: 2226 | 2056 passed | 143 failed | 27 failed as expected
 
diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
index 920a1c7a..045f7e0d 100644
--- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
@@ -9258,17 +9258,27 @@ with expansion:
   false == false
 
 CmdLine.tests.cpp:<line number>: PASSED:
-  CHECK( config.reporterSpecifications == std::vector<Catch::ConfigData::ReporterAndFile>{ {"console", {}} } )
+  CHECK( config.reporterSpecifications.empty() )
 with expansion:
-  { { console, <default-output> } }
-  ==
-  { { console, <default-output> } }
+  true
 
 CmdLine.tests.cpp:<line number>: PASSED:
   CHECK_FALSE( cfg.hasTestFilters() )
 with expansion:
   !false
 
+CmdLine.tests.cpp:<line number>: PASSED:
+  CHECK( cfg.getReportersAndOutputFiles().size() == 1 )
+with expansion:
+  1 == 1
+
+CmdLine.tests.cpp:<line number>: PASSED:
+  CHECK( cfg.getReportersAndOutputFiles()[0] == Catch::ConfigData::ReporterAndFile{ expectedReporter, {} } )
+with expansion:
+  { console, <default-output> }
+  ==
+  { console, <default-output> }
+
 -------------------------------------------------------------------------------
 Process can be configured on command line
   test lists
@@ -17747,5 +17757,5 @@ Misc.tests.cpp:<line number>: PASSED:
 
 ===============================================================================
 test cases:  381 |  291 passed |  83 failed |  7 failed as expected
-assertions: 2224 | 2054 passed | 143 failed | 27 failed as expected
+assertions: 2226 | 2056 passed | 143 failed | 27 failed as expected
 
diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt
index c020fa4b..b259f75d 100644
--- a/tests/SelfTest/Baselines/junit.sw.approved.txt
+++ b/tests/SelfTest/Baselines/junit.sw.approved.txt
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <testsuitesloose text artifact
 >
-  <testsuite name="<exe-name>" errors="17" failures="126" tests="2224" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+  <testsuite name="<exe-name>" errors="17" failures="126" tests="2226" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
     <properties>
       <property name="random-seed" value="1"/>
       <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/>
diff --git a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
index 91398339..26b2f904 100644
--- a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <testsuites>
-  <testsuite name="<exe-name>" errors="17" failures="126" tests="2224" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+  <testsuite name="<exe-name>" errors="17" failures="126" tests="2226" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
     <properties>
       <property name="random-seed" value="1"/>
       <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/>
diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt
index bd0e9881..5c36015e 100644
--- a/tests/SelfTest/Baselines/tap.sw.approved.txt
+++ b/tests/SelfTest/Baselines/tap.sw.approved.txt
@@ -2453,10 +2453,14 @@ ok {test-number} - config.abortAfter == -1 for: -1 == -1
 # Process can be configured on command line
 ok {test-number} - config.noThrow == false for: false == false
 # Process can be configured on command line
-ok {test-number} - config.reporterSpecifications == std::vector<Catch::ConfigData::ReporterAndFile>{ {"console", {}} } for: { { console, <default-output> } } == { { console, <default-output> } }
+ok {test-number} - config.reporterSpecifications.empty() for: true
 # Process can be configured on command line
 ok {test-number} - !(cfg.hasTestFilters()) for: !false
 # Process can be configured on command line
+ok {test-number} - cfg.getReportersAndOutputFiles().size() == 1 for: 1 == 1
+# Process can be configured on command line
+ok {test-number} - cfg.getReportersAndOutputFiles()[0] == Catch::ConfigData::ReporterAndFile{ expectedReporter, {} } for: { console, <default-output> } == { console, <default-output> }
+# Process can be configured on command line
 ok {test-number} - result for: {?}
 # Process can be configured on command line
 ok {test-number} - cfg.hasTestFilters() for: true
@@ -4450,5 +4454,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
 ok {test-number} -
 # xmlentitycheck
 ok {test-number} -
-1..2224
+1..2226
 
diff --git a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt
index 59e8d1a8..9eb4aaca 100644
--- a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt
@@ -2451,10 +2451,14 @@ ok {test-number} - config.abortAfter == -1 for: -1 == -1
 # Process can be configured on command line
 ok {test-number} - config.noThrow == false for: false == false
 # Process can be configured on command line
-ok {test-number} - config.reporterSpecifications == std::vector<Catch::ConfigData::ReporterAndFile>{ {"console", {}} } for: { { console, <default-output> } } == { { console, <default-output> } }
+ok {test-number} - config.reporterSpecifications.empty() for: true
 # Process can be configured on command line
 ok {test-number} - !(cfg.hasTestFilters()) for: !false
 # Process can be configured on command line
+ok {test-number} - cfg.getReportersAndOutputFiles().size() == 1 for: 1 == 1
+# Process can be configured on command line
+ok {test-number} - cfg.getReportersAndOutputFiles()[0] == Catch::ConfigData::ReporterAndFile{ expectedReporter, {} } for: { console, <default-output> } == { console, <default-output> }
+# Process can be configured on command line
 ok {test-number} - result for: {?}
 # Process can be configured on command line
 ok {test-number} - cfg.hasTestFilters() for: true
@@ -4442,5 +4446,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
 ok {test-number} -
 # xmlentitycheck
 ok {test-number} -
-1..2224
+1..2226
 
diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt
index 49b11484..91dc7e3c 100644
--- a/tests/SelfTest/Baselines/xml.sw.approved.txt
+++ b/tests/SelfTest/Baselines/xml.sw.approved.txt
@@ -11289,12 +11289,10 @@ Nor would this
       </Expression>
       <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
         <Original>
-          config.reporterSpecifications == std::vector&lt;Catch::ConfigData::ReporterAndFile>{ {"console", {}} }
+          config.reporterSpecifications.empty()
         </Original>
         <Expanded>
-          { { console, &lt;default-output> } }
-==
-{ { console, &lt;default-output> } }
+          true
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
@@ -11305,7 +11303,25 @@ Nor would this
           !false
         </Expanded>
       </Expression>
-      <OverallResults successes="7" failures="0" expectedFailures="0"/>
+      <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
+        <Original>
+          cfg.getReportersAndOutputFiles().size() == 1
+        </Original>
+        <Expanded>
+          1 == 1
+        </Expanded>
+      </Expression>
+      <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
+        <Original>
+          cfg.getReportersAndOutputFiles()[0] == Catch::ConfigData::ReporterAndFile{ expectedReporter, {} }
+        </Original>
+        <Expanded>
+          { console, &lt;default-output> }
+==
+{ console, &lt;default-output> }
+        </Expanded>
+      </Expression>
+      <OverallResults successes="9" failures="0" expectedFailures="0"/>
     </Section>
     <Section name="test lists" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
       <Section name="Specify one test case using" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
@@ -20863,6 +20879,6 @@ loose text artifact
     </Section>
     <OverallResult success="true"/>
   </TestCase>
-  <OverallResults successes="2054" failures="143" expectedFailures="27"/>
+  <OverallResults successes="2056" failures="143" expectedFailures="27"/>
   <OverallResultsCases successes="291" failures="83" expectedFailures="7"/>
 </Catch2TestRun>
diff --git a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt
index f73fe121..e7dddbb0 100644
--- a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt
@@ -11289,12 +11289,10 @@ Nor would this
       </Expression>
       <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
         <Original>
-          config.reporterSpecifications == std::vector&lt;Catch::ConfigData::ReporterAndFile>{ {"console", {}} }
+          config.reporterSpecifications.empty()
         </Original>
         <Expanded>
-          { { console, &lt;default-output> } }
-==
-{ { console, &lt;default-output> } }
+          true
         </Expanded>
       </Expression>
       <Expression success="true" type="CHECK_FALSE" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
@@ -11305,7 +11303,25 @@ Nor would this
           !false
         </Expanded>
       </Expression>
-      <OverallResults successes="7" failures="0" expectedFailures="0"/>
+      <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
+        <Original>
+          cfg.getReportersAndOutputFiles().size() == 1
+        </Original>
+        <Expanded>
+          1 == 1
+        </Expanded>
+      </Expression>
+      <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
+        <Original>
+          cfg.getReportersAndOutputFiles()[0] == Catch::ConfigData::ReporterAndFile{ expectedReporter, {} }
+        </Original>
+        <Expanded>
+          { console, &lt;default-output> }
+==
+{ console, &lt;default-output> }
+        </Expanded>
+      </Expression>
+      <OverallResults successes="9" failures="0" expectedFailures="0"/>
     </Section>
     <Section name="test lists" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
       <Section name="Specify one test case using" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" >
@@ -20862,6 +20878,6 @@ There is no extra whitespace here
     </Section>
     <OverallResult success="true"/>
   </TestCase>
-  <OverallResults successes="2054" failures="143" expectedFailures="27"/>
+  <OverallResults successes="2056" failures="143" expectedFailures="27"/>
   <OverallResultsCases successes="291" failures="83" expectedFailures="7"/>
 </Catch2TestRun>
diff --git a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
index b4ec826b..97bccf49 100644
--- a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
@@ -11,6 +11,7 @@
 #include <catch2/catch_test_macros.hpp>
 #include <catch2/matchers/catch_matchers_string.hpp>
 #include <catch2/internal/catch_test_spec_parser.hpp>
+#include <catch2/catch_user_config.hpp>
 #include <catch2/catch_test_case_info.hpp>
 #include <catch2/internal/catch_commandline.hpp>
 #include <catch2/generators/catch_generators.hpp>
@@ -348,10 +349,23 @@ TEST_CASE( "Process can be configured on command line", "[config][command-line]"
         CHECK(config.shouldDebugBreak == false);
         CHECK(config.abortAfter == -1);
         CHECK(config.noThrow == false);
-        CHECK(config.reporterSpecifications == std::vector<Catch::ConfigData::ReporterAndFile>{ {"console", {}} });
+        CHECK( config.reporterSpecifications.empty() );
 
         Catch::Config cfg(config);
         CHECK_FALSE(cfg.hasTestFilters());
+
+        // The Config is responsible for mixing in the default reporter
+        auto expectedReporter =
+#if defined( CATCH_CONFIG_DEFAULT_REPORTER )
+            CATCH_CONFIG_DEFAULT_REPORTER
+#else
+            "console"
+#endif
+            ;
+
+        CHECK( cfg.getReportersAndOutputFiles().size() == 1 );
+        CHECK( cfg.getReportersAndOutputFiles()[0] ==
+               Catch::ConfigData::ReporterAndFile{ expectedReporter, {} } );
     }
 
     SECTION("test lists") {