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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/interfaces/catch_interfaces_reporter.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-04-04 21:07:04 +0200
committerMartin Hořeňovský2022-04-07 12:50:08 +0200
commit423e1d2ebbd75bb92cb486f83f2c5800b4b9689e (patch)
tree3cfff7f75517b1771ab43c7439ba195a77dcec31 /src/catch2/interfaces/catch_interfaces_reporter.cpp
parent3c06bcb374aaebf91ad1d63aba655dee66cf7b91 (diff)
downloadcatch3-423e1d2ebbd75bb92cb486f83f2c5800b4b9689e.tar.gz
Integrate the new reporter specs into Catch2
This means that the CLI interface now uses the new key-value oriented reporter spec, the common reporter base creates the colour implementation based on the reporter-specific configuration, and it also stores the custom configuration options for each reporter instance. Closes #339 as it allows per-reporter forcing of ansi colour codes.
Diffstat (limited to 'src/catch2/interfaces/catch_interfaces_reporter.cpp')
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/catch2/interfaces/catch_interfaces_reporter.cpp b/src/catch2/interfaces/catch_interfaces_reporter.cpp
index 5f5d274a..585d4365 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter.cpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter.cpp
@@ -14,17 +14,31 @@
#include <catch2/internal/catch_string_manip.hpp>
#include <catch2/catch_test_case_info.hpp>
#include <catch2/reporters/catch_reporter_helpers.hpp>
+#include <catch2/internal/catch_move_and_forward.hpp>
#include <algorithm>
#include <iomanip>
namespace Catch {
- ReporterConfig::ReporterConfig( IConfig const* _fullConfig, IStream const* _stream )
- : m_stream( _stream ), m_fullConfig( _fullConfig ) {}
+ ReporterConfig::ReporterConfig(
+ IConfig const* _fullConfig,
+ IStream const* _stream,
+ ColourMode colourMode,
+ std::map<std::string, std::string> customOptions ):
+ m_stream( _stream ),
+ m_fullConfig( _fullConfig ),
+ m_colourMode( colourMode ),
+ m_customOptions( CATCH_MOVE( customOptions ) ) {}
IStream const* ReporterConfig::stream() const { return m_stream; }
IConfig const * ReporterConfig::fullConfig() const { return m_fullConfig; }
+ ColourMode ReporterConfig::colourMode() const { return m_colourMode; }
+
+ std::map<std::string, std::string> const&
+ ReporterConfig::customOptions() const {
+ return m_customOptions;
+ }
AssertionStats::AssertionStats( AssertionResult const& _assertionResult,
std::vector<MessageInfo> const& _infoMessages,