| 13295 | } |
| 13296 | |
| 13297 | IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) { |
| 13298 | if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) { |
| 13299 | return createReporter(config->getReporterName(), config); |
| 13300 | } |
| 13301 | |
| 13302 | // On older platforms, returning std::unique_ptr<ListeningReporter> |
| 13303 | // when the return type is std::unique_ptr<IStreamingReporter> |
| 13304 | // doesn't compile without a std::move call. However, this causes |
| 13305 | // a warning on newer platforms. Thus, we have to work around |
| 13306 | // it a bit and downcast the pointer manually. |
| 13307 | auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter); |
| 13308 | auto& multi = static_cast<ListeningReporter&>(*ret); |
| 13309 | auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); |
| 13310 | for (auto const& listener : listeners) { |
| 13311 | multi.addListener(listener->create(Catch::ReporterConfig(config))); |
| 13312 | } |
| 13313 | multi.addReporter(createReporter(config->getReporterName(), config)); |
| 13314 | return ret; |
| 13315 | } |
| 13316 | |
| 13317 | class TestGroup { |
| 13318 | public: |