| 13089 | } |
| 13090 | |
| 13091 | IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) { |
| 13092 | if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) { |
| 13093 | return createReporter(config->getReporterName(), config); |
| 13094 | } |
| 13095 | |
| 13096 | // On older platforms, returning std::unique_ptr<ListeningReporter> |
| 13097 | // when the return type is std::unique_ptr<IStreamingReporter> |
| 13098 | // doesn't compile without a std::move call. However, this causes |
| 13099 | // a warning on newer platforms. Thus, we have to work around |
| 13100 | // it a bit and downcast the pointer manually. |
| 13101 | auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter); |
| 13102 | auto& multi = static_cast<ListeningReporter&>(*ret); |
| 13103 | auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); |
| 13104 | for (auto const& listener : listeners) { |
| 13105 | multi.addListener(listener->create(Catch::ReporterConfig(config))); |
| 13106 | } |
| 13107 | multi.addReporter(createReporter(config->getReporterName(), config)); |
| 13108 | return ret; |
| 13109 | } |
| 13110 | |
| 13111 | class TestGroup { |
| 13112 | public: |