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