| 12674 | } |
| 12675 | |
| 12676 | IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) { |
| 12677 | if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) { |
| 12678 | return createReporter(config->getReporterName(), config); |
| 12679 | } |
| 12680 | |
| 12681 | // On older platforms, returning std::unique_ptr<ListeningReporter> |
| 12682 | // when the return type is std::unique_ptr<IStreamingReporter> |
| 12683 | // doesn't compile without a std::move call. However, this causes |
| 12684 | // a warning on newer platforms. Thus, we have to work around |
| 12685 | // it a bit and downcast the pointer manually. |
| 12686 | auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter); |
| 12687 | auto& multi = static_cast<ListeningReporter&>(*ret); |
| 12688 | auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners(); |
| 12689 | for (auto const& listener : listeners) { |
| 12690 | multi.addListener(listener->create(Catch::ReporterConfig(config))); |
| 12691 | } |
| 12692 | multi.addReporter(createReporter(config->getReporterName(), config)); |
| 12693 | return ret; |
| 12694 | } |
| 12695 | |
| 12696 | class TestGroup { |
| 12697 | public: |