Hold reporter's IConfig instance in the interface

Previously, every base derived from the IStreamingReporter had
its own `IConfig const* m_config` member, so this just centralizes
the handling thereof.

Part of #2061
This commit is contained in:
Martin Hořeňovský
2021-01-16 15:27:56 +01:00
parent ba81505168
commit 74f2f4ba5e
7 changed files with 17 additions and 15 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ namespace Catch {
// doesn't compile without a std::move call. However, this causes
// a warning on newer platforms. Thus, we have to work around
// it a bit and downcast the pointer manually.
auto ret = Detail::unique_ptr<IStreamingReporter>(new ListeningReporter);
auto ret = Detail::unique_ptr<IStreamingReporter>(new ListeningReporter(config));
auto& multi = static_cast<ListeningReporter&>(*ret);
auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners();
for (auto const& listener : listeners) {