MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/TriangleMeshDistance / makeReporter

Function makeReporter

tests/catch.hpp:10633–10651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers 1

runTestsFunction · 0.85

Calls 6

createReporterFunction · 0.85
ReporterConfigClass · 0.85
addListenerMethod · 0.80
addReporterMethod · 0.80
emptyMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected