MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / makeReporter

Function makeReporter

extlibs/catch/include/catch/catch.hpp:12676–12694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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:

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