MCPcopy Create free account
hub / github.com/apache/thrift / listReporters

Function listReporters

compiler/cpp/tests/catch/catch.hpp:5915–5936  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5913 }
5914
5915 inline std::size_t listReporters( Config const& /*config*/ ) {
5916 Catch::cout() << "Available reporters:\n";
5917 IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
5918 IReporterRegistry::FactoryMap::const_iterator itBegin = factories.begin(), itEnd = factories.end(), it;
5919 std::size_t maxNameLen = 0;
5920 for(it = itBegin; it != itEnd; ++it )
5921 maxNameLen = (std::max)( maxNameLen, it->first.size() );
5922
5923 for(it = itBegin; it != itEnd; ++it ) {
5924 Text wrapper( it->second->getDescription(), TextAttributes()
5925 .setInitialIndent( 0 )
5926 .setIndent( 7+maxNameLen )
5927 .setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 ) );
5928 Catch::cout() << " "
5929 << it->first
5930 << ':'
5931 << std::string( maxNameLen - it->first.size() + 2, ' ' )
5932 << wrapper << '\n';
5933 }
5934 Catch::cout() << std::endl;
5935 return factories.size();
5936 }
5937
5938 inline Option<std::size_t> list( Config const& config ) {
5939 Option<std::size_t> listedCount;

Callers 1

listFunction · 0.85

Calls 6

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

Tested by

no test coverage detected