Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Outline the actual registering of listener factories to cpp file

Commit
72f3ce4db5620ba54f9da9f60cd4076d322d98ae
Author
Martin Hořeňovský ·
Parents
62167d756e13

Files · Download .tar.gz

Changes

 src/catch2/reporters/catch_reporter_registrars.cpp | 5 +++++
 src/catch2/reporters/catch_reporter_registrars.hpp | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/catch2/reporters/catch_reporter_registrars.cpp b/src/catch2/reporters/catch_reporter_registrars.cpp
index a9787ce5..17f59517 100644
--- a/src/catch2/reporters/catch_reporter_registrars.cpp
+++ b/src/catch2/reporters/catch_reporter_registrars.cpp
@@ -26,5 +26,10 @@ namespace Catch {
             }
         }
 
+        void registerListenerImpl( Detail::unique_ptr<EventListenerFactory> listenerFactory ) {
+            getMutableRegistryHub().registerListener( CATCH_MOVE(listenerFactory) );
+        }
+
+
     } // namespace Detail
 } // namespace Catch
diff --git a/src/catch2/reporters/catch_reporter_registrars.hpp b/src/catch2/reporters/catch_reporter_registrars.hpp
index db5688f2..cab395f4 100644
--- a/src/catch2/reporters/catch_reporter_registrars.hpp
+++ b/src/catch2/reporters/catch_reporter_registrars.hpp
@@ -36,7 +36,8 @@ namespace Catch {
         //! independent on the reporter's concrete type
         void registerReporterImpl( std::string const& name,
                                    IReporterFactoryPtr reporterPtr );
-
+        //! Actually registers the factory, independent on listener's concrete type
+        void registerListenerImpl( Detail::unique_ptr<EventListenerFactory> listenerFactory );
     } // namespace Detail
 
     class IEventListener;
@@ -97,7 +98,7 @@ namespace Catch {
 
     public:
         ListenerRegistrar(StringRef listenerName) {
-            getMutableRegistryHub().registerListener( Detail::make_unique<TypedListenerFactory>(listenerName) );
+            registerListenerImpl( Detail::make_unique<TypedListenerFactory>(listenerName) );
         }
     };
 }