diff options
| author | Martin Jeřábek | 2021-02-06 20:12:07 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-01-01 14:02:23 +0100 |
| commit | ccd67b293d7595a0cf2dc6c4bfb2017fc18c1f14 (patch) | |
| tree | ba5f166d1cf867ad97617656083354fbddfc5d9f /src/catch2/interfaces | |
| parent | 6b55f5d780c5d8e935720f9d7d8ed28a3ba8617f (diff) | |
| download | catch3-ccd67b293d7595a0cf2dc6c4bfb2017fc18c1f14.tar.gz | |
Add support for multiple parallel reporters
This requires a bunch of different changes across the reporter
subsystem.
* We need to handle multiple reporters and their differing
preferences in `ListeningReporter`, e.g. what to do when
we mix reporters that capture and don't capture stdout.
* We need to change how the reporter is given output and
how we parse reporter's output destination from CLI.
* Approval tests need to handle multireporter option
Diffstat (limited to 'src/catch2/interfaces')
4 files changed, 3 insertions, 7 deletions
diff --git a/src/catch2/interfaces/catch_interfaces_config.hpp b/src/catch2/interfaces/catch_interfaces_config.hpp index b8da0df0..4b2bd365 100644 --- a/src/catch2/interfaces/catch_interfaces_config.hpp +++ b/src/catch2/interfaces/catch_interfaces_config.hpp @@ -61,7 +61,7 @@ namespace Catch { virtual ~IConfig(); virtual bool allowThrows() const = 0; - virtual std::ostream& stream() const = 0; + virtual std::ostream& defaultStream() const = 0; virtual StringRef name() const = 0; virtual bool includeSuccessfulResults() const = 0; virtual bool shouldDebugBreak() const = 0; diff --git a/src/catch2/interfaces/catch_interfaces_reporter.cpp b/src/catch2/interfaces/catch_interfaces_reporter.cpp index 89a86f59..5439254c 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.cpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.cpp @@ -20,9 +20,6 @@ namespace Catch { - ReporterConfig::ReporterConfig( IConfig const* _fullConfig ) - : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {} - ReporterConfig::ReporterConfig( IConfig const* _fullConfig, std::ostream& _stream ) : m_stream( &_stream ), m_fullConfig( _fullConfig ) {} diff --git a/src/catch2/interfaces/catch_interfaces_reporter.hpp b/src/catch2/interfaces/catch_interfaces_reporter.hpp index 5d3e85a3..432bc4e5 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.hpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.hpp @@ -32,8 +32,6 @@ namespace Catch { struct IConfig; struct ReporterConfig { - explicit ReporterConfig( IConfig const* _fullConfig ); - ReporterConfig( IConfig const* _fullConfig, std::ostream& _stream ); std::ostream& stream() const; diff --git a/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp b/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp index 57c652e7..582c39b4 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp +++ b/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp @@ -23,13 +23,14 @@ namespace Catch { using IStreamingReporterPtr = Detail::unique_ptr<IStreamingReporter>; struct IReporterFactory; using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>; + struct ReporterConfig; struct IReporterRegistry { using FactoryMap = std::map<std::string, IReporterFactoryPtr, Detail::CaseInsensitiveLess>; using Listeners = std::vector<IReporterFactoryPtr>; virtual ~IReporterRegistry(); // = default - virtual IStreamingReporterPtr create( std::string const& name, IConfig const* config ) const = 0; + virtual IStreamingReporterPtr create( std::string const& name, ReporterConfig const& config ) const = 0; virtual FactoryMap const& getFactories() const = 0; virtual Listeners const& getListeners() const = 0; }; |