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

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest/IntrospectiveTests
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 /tests/SelfTest/IntrospectiveTests
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 'tests/SelfTest/IntrospectiveTests')
-rw-r--r--tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp16
1 files changed, 15 insertions, 1 deletions
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") {