diff options
| author | Martin Hořeňovský | 2022-04-04 21:07:04 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-04-07 12:50:08 +0200 |
| commit | 423e1d2ebbd75bb92cb486f83f2c5800b4b9689e (patch) | |
| tree | 3cfff7f75517b1771ab43c7439ba195a77dcec31 /src/catch2/interfaces/catch_interfaces_reporter.cpp | |
| parent | 3c06bcb374aaebf91ad1d63aba655dee66cf7b91 (diff) | |
| download | catch3-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.cpp | 18 |
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, |