MCPcopy Create free account
hub / github.com/Profactor/cv-plot / makeReporter

Function makeReporter

CvPlot/ext/catch2/inc/catch.hpp:13073–13091  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13071 }
13072
13073 IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) {
13074 if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) {
13075 return createReporter(config->getReporterName(), config);
13076 }
13077
13078 // On older platforms, returning std::unique_ptr<ListeningReporter>
13079 // when the return type is std::unique_ptr<IStreamingReporter>
13080 // doesn't compile without a std::move call. However, this causes
13081 // a warning on newer platforms. Thus, we have to work around
13082 // it a bit and downcast the pointer manually.
13083 auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter);
13084 auto& multi = static_cast<ListeningReporter&>(*ret);
13085 auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners();
13086 for (auto const& listener : listeners) {
13087 multi.addListener(listener->create(Catch::ReporterConfig(config)));
13088 }
13089 multi.addReporter(createReporter(config->getReporterName(), config));
13090 return ret;
13091 }
13092
13093 class TestGroup {
13094 public:

Callers 1

TestGroupMethod · 0.85

Calls 6

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

Tested by 1

TestGroupMethod · 0.68