| 13071 | } |
| 13072 | |
| 13073 | IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) { |
| 13074 | if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) { |
| 13075 | return createReporter(config->getReporterName(), config); |
| 13076 | } |
| 13077 | |
| 13078 | // On older platforms, returning std::unique_ptr<ListeningReporter> |
| 13079 | // when the return type is std::unique_ptr<IStreamingReporter> |
| 13080 | // doesn't compile without a std::move call. However, this causes |
| 13081 | // a warning on newer platforms. Thus, we have to work around |
| 13082 | // it a bit and downcast the pointer manually. |
| 13083 | auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter); |
| 13084 | auto& multi = static_cast<ListeningReporter&>(*ret); |
| 13085 | auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); |
| 13086 | for (auto const& listener : listeners) { |
| 13087 | multi.addListener(listener->create(Catch::ReporterConfig(config))); |
| 13088 | } |
| 13089 | multi.addReporter(createReporter(config->getReporterName(), config)); |
| 13090 | return ret; |
| 13091 | } |
| 13092 | |
| 13093 | class TestGroup { |
| 13094 | public: |