MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / listReporters

Function listReporters

unittests/catch.hpp:7829–7849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7827 }
7828
7829 std::size_t listReporters( Config const& /*config*/ ) {
7830 Catch::cout() << "Available reporters:\n";
7831 IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
7832 std::size_t maxNameLen = 0;
7833 for( auto const& factoryKvp : factories )
7834 maxNameLen = (std::max)( maxNameLen, factoryKvp.first.size() );
7835
7836 for( auto const& factoryKvp : factories ) {
7837 Catch::cout()
7838 << Column( factoryKvp.first + ":" )
7839 .indent(2)
7840 .width( 5+maxNameLen )
7841 + Column( factoryKvp.second->getDescription() )
7842 .initialIndent(0)
7843 .indent(2)
7844 .width( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 )
7845 << "\n";
7846 }
7847 Catch::cout() << std::endl;
7848 return factories.size();
7849 }
7850
7851 Option<std::size_t> list( Config const& config ) {
7852 Option<std::size_t> listedCount;

Callers 1

listFunction · 0.85

Calls 6

ColumnClass · 0.85
widthMethod · 0.80
initialIndentMethod · 0.80
sizeMethod · 0.45
indentMethod · 0.45
getDescriptionMethod · 0.45

Tested by

no test coverage detected