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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-03-15 15:35:03 +0100
committerMartin Hořeňovský2023-03-20 19:37:27 +0100
commit72f3ce4db5620ba54f9da9f60cd4076d322d98ae (patch)
treeb3d8f85875350a95928bfddf4b924f16e993650c /src/catch2
parent62167d756e13d8f053b397c07f1192d8e308f2c5 (diff)
downloadcatch3-72f3ce4db5620ba54f9da9f60cd4076d322d98ae.tar.gz
Outline the actual registering of listener factories to cpp file
Diffstat (limited to 'src/catch2')
-rw-r--r--src/catch2/reporters/catch_reporter_registrars.cpp5
-rw-r--r--src/catch2/reporters/catch_reporter_registrars.hpp5
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) );
}
};
}