| 10896 | } |
| 10897 | |
| 10898 | IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) { |
| 10899 | if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) { |
| 10900 | return createReporter(config->getReporterName(), config); |
| 10901 | } |
| 10902 | |
| 10903 | // On older platforms, returning std::unique_ptr<ListeningReporter> |
| 10904 | // when the return type is std::unique_ptr<IStreamingReporter> |
| 10905 | // doesn't compile without a std::move call. However, this causes |
| 10906 | // a warning on newer platforms. Thus, we have to work around |
| 10907 | // it a bit and downcast the pointer manually. |
| 10908 | auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter); |
| 10909 | auto& multi = static_cast<ListeningReporter&>(*ret); |
| 10910 | auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); |
| 10911 | for (auto const& listener : listeners) { |
| 10912 | multi.addListener(listener->create(Catch::ReporterConfig(config))); |
| 10913 | } |
| 10914 | multi.addReporter(createReporter(config->getReporterName(), config)); |
| 10915 | return ret; |
| 10916 | } |
| 10917 | |
| 10918 | Catch::Totals runTests(std::shared_ptr<Config> const& config) { |
| 10919 | auto reporter = makeReporter(config); |
no test coverage detected