MCPcopy Create free account
hub / github.com/catchorg/Catch2 / prepareReporters

Function prepareReporters

extras/catch_amalgamated.cpp:1211–1240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1209 }
1210
1211 IEventListenerPtr prepareReporters(Config const* config) {
1212 if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()
1213 && config->getProcessedReporterSpecs().size() == 1) {
1214 auto const& spec = config->getProcessedReporterSpecs()[0];
1215 return createReporter(
1216 spec.name,
1217 ReporterConfig( config,
1218 makeStream( spec.outputFilename ),
1219 spec.colourMode,
1220 spec.customOptions ) );
1221 }
1222
1223 auto multi = Detail::make_unique<MultiReporter>(config);
1224
1225 auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners();
1226 for (auto const& listener : listeners) {
1227 multi->addListener(listener->create(config));
1228 }
1229
1230 for ( auto const& reporterSpec : config->getProcessedReporterSpecs() ) {
1231 multi->addReporter( createReporter(
1232 reporterSpec.name,
1233 ReporterConfig( config,
1234 makeStream( reporterSpec.outputFilename ),
1235 reporterSpec.colourMode,
1236 reporterSpec.customOptions ) ) );
1237 }
1238
1239 return multi;
1240 }
1241
1242 class TestGroup {
1243 public:

Callers 1

runInternalMethod · 0.70

Calls 8

createReporterFunction · 0.70
ReporterConfigClass · 0.70
makeStreamFunction · 0.70
emptyMethod · 0.45
sizeMethod · 0.45
addListenerMethod · 0.45
createMethod · 0.45
addReporterMethod · 0.45

Tested by

no test coverage detected