MCPcopy Create free account
hub / github.com/FidoProject/Fido / listReporters

Function listReporters

tests/catch.h:5408–5429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5406 }
5407
5408 inline std::size_t listReporters( Config const& /*config*/ ) {
5409 Catch::cout() << "Available reporters:\n";
5410 IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
5411 IReporterRegistry::FactoryMap::const_iterator itBegin = factories.begin(), itEnd = factories.end(), it;
5412 std::size_t maxNameLen = 0;
5413 for(it = itBegin; it != itEnd; ++it )
5414 maxNameLen = (std::max)( maxNameLen, it->first.size() );
5415
5416 for(it = itBegin; it != itEnd; ++it ) {
5417 Text wrapper( it->second->getDescription(), TextAttributes()
5418 .setInitialIndent( 0 )
5419 .setIndent( 7+maxNameLen )
5420 .setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 ) );
5421 Catch::cout() << " "
5422 << it->first
5423 << ":"
5424 << std::string( maxNameLen - it->first.size() + 2, ' ' )
5425 << wrapper << "\n";
5426 }
5427 Catch::cout() << std::endl;
5428 return factories.size();
5429 }
5430
5431 inline Option<std::size_t> list( Config const& config ) {
5432 Option<std::size_t> listedCount;

Callers 1

listFunction · 0.85

Calls 5

TextAttributesClass · 0.85
beginMethod · 0.80
endMethod · 0.80
sizeMethod · 0.45
getDescriptionMethod · 0.45

Tested by

no test coverage detected