MCPcopy Create free account
hub / github.com/RenderKit/embree / makeReporter

Function makeReporter

tutorials/external/catch.hpp:10898–10916  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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