| 10631 | } |
| 10632 | |
| 10633 | IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) { |
| 10634 | if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) { |
| 10635 | return createReporter(config->getReporterName(), config); |
| 10636 | } |
| 10637 | |
| 10638 | // On older platforms, returning std::unique_ptr<ListeningReporter> |
| 10639 | // when the return type is std::unique_ptr<IStreamingReporter> |
| 10640 | // doesn't compile without a std::move call. However, this causes |
| 10641 | // a warning on newer platforms. Thus, we have to work around |
| 10642 | // it a bit and downcast the pointer manually. |
| 10643 | auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter); |
| 10644 | auto& multi = static_cast<ListeningReporter&>(*ret); |
| 10645 | auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); |
| 10646 | for (auto const& listener : listeners) { |
| 10647 | multi.addListener(listener->create(Catch::ReporterConfig(config))); |
| 10648 | } |
| 10649 | multi.addReporter(createReporter(config->getReporterName(), config)); |
| 10650 | return ret; |
| 10651 | } |
| 10652 | |
| 10653 | Catch::Totals runTests(std::shared_ptr<Config> const& config) { |
| 10654 | auto reporter = makeReporter(config); |
no test coverage detected