diff options
| author | Martin Hořeňovský | 2022-03-14 15:04:42 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-03-18 00:36:18 +0100 |
| commit | 4acc520f763f7a104d11d57afb8d3bab0bfa6ebc (patch) | |
| tree | 4bcbf287b1db41c6d8608905ca82471545517992 /src/catch2/internal | |
| parent | 18c58667d780bfdc82d0e52d6ac6afc462e28f47 (diff) | |
| download | catch3-4acc520f763f7a104d11d57afb8d3bab0bfa6ebc.tar.gz | |
Event listeners no longer take reporter config in constructor
This also required splitting out Listener factory from
the reporter factory hierarchy. In return, the listener
factories only need to take in `IConfig const*`, which
opens up further refactorings down the road in the colour
selection and implementation.
Diffstat (limited to 'src/catch2/internal')
| -rw-r--r-- | src/catch2/internal/catch_reporter_registry.cpp | 3 | ||||
| -rw-r--r-- | src/catch2/internal/catch_reporter_registry.hpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/catch2/internal/catch_reporter_registry.cpp b/src/catch2/internal/catch_reporter_registry.cpp index 67687d1b..7ac3a606 100644 --- a/src/catch2/internal/catch_reporter_registry.cpp +++ b/src/catch2/internal/catch_reporter_registry.cpp @@ -49,7 +49,8 @@ namespace Catch { "'::' is not allowed in reporter name: '" + name + '\'' ); m_factories.emplace(name, CATCH_MOVE(factory)); } - void ReporterRegistry::registerListener( IReporterFactoryPtr factory ) { + void ReporterRegistry::registerListener( + Detail::unique_ptr<EventListenerFactory> factory ) { m_listeners.push_back( CATCH_MOVE(factory) ); } diff --git a/src/catch2/internal/catch_reporter_registry.hpp b/src/catch2/internal/catch_reporter_registry.hpp index a761e7cf..aaa99ba0 100644 --- a/src/catch2/internal/catch_reporter_registry.hpp +++ b/src/catch2/internal/catch_reporter_registry.hpp @@ -24,7 +24,7 @@ namespace Catch { IStreamingReporterPtr create( std::string const& name, ReporterConfig const& config ) const override; void registerReporter( std::string const& name, IReporterFactoryPtr factory ); - void registerListener( IReporterFactoryPtr factory ); + void registerListener( Detail::unique_ptr<EventListenerFactory> factory ); FactoryMap const& getFactories() const override; Listeners const& getListeners() const override; |