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

Function makeReporter

test/expected/catch.hpp:13091–13109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13089 }
13090
13091 IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) {
13092 if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) {
13093 return createReporter(config->getReporterName(), config);
13094 }
13095
13096 // On older platforms, returning std::unique_ptr<ListeningReporter>
13097 // when the return type is std::unique_ptr<IStreamingReporter>
13098 // doesn't compile without a std::move call. However, this causes
13099 // a warning on newer platforms. Thus, we have to work around
13100 // it a bit and downcast the pointer manually.
13101 auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter);
13102 auto& multi = static_cast<ListeningReporter&>(*ret);
13103 auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners();
13104 for (auto const& listener : listeners) {
13105 multi.addListener(listener->create(Catch::ReporterConfig(config)));
13106 }
13107 multi.addReporter(createReporter(config->getReporterName(), config));
13108 return ret;
13109 }
13110
13111 class TestGroup {
13112 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