| 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; |
no test coverage detected