MCPcopy Create free account
hub / github.com/apache/qpid-proton / makeReporter

Function makeReporter

tests/include/catch.hpp:13308–13326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13306 }
13307
13308 IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) {
13309 if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) {
13310 return createReporter(config->getReporterName(), config);
13311 }
13312
13313 // On older platforms, returning std::unique_ptr<ListeningReporter>
13314 // when the return type is std::unique_ptr<IStreamingReporter>
13315 // doesn't compile without a std::move call. However, this causes
13316 // a warning on newer platforms. Thus, we have to work around
13317 // it a bit and downcast the pointer manually.
13318 auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter);
13319 auto& multi = static_cast<ListeningReporter&>(*ret);
13320 auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners();
13321 for (auto const& listener : listeners) {
13322 multi.addListener(listener->create(Catch::ReporterConfig(config)));
13323 }
13324 multi.addReporter(createReporter(config->getReporterName(), config));
13325 return ret;
13326 }
13327
13328 class TestGroup {
13329 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