32 if(
config.hasTestFilters() )
39 for(
auto const& testCaseInfo : matchedTestCases ) {
43 Colour colourGuard( colour );
48 std::string description = testCaseInfo.description;
49 if( description.empty() )
50 description =
"(NO DESCRIPTION)";
53 if( !testCaseInfo.tags.empty() )
57 if( !
config.hasTestFilters() )
60 Catch::cout() <<
pluralise( matchedTestCases.size(),
"matching test case" ) <<
'\n' << std::endl;
61 return matchedTestCases.size();
66 std::size_t matchedTests = 0;
68 for(
auto const& testCaseInfo : matchedTestCases ) {
89 out +=
"[" + spelling +
"]";
95 if(
config.hasTestFilters() )
101 std::map<std::string, TagInfo> tagCounts;
104 for(
auto const& testCase : matchedTestCases ) {
105 for(
auto const& tagName : testCase.getTestCaseInfo().tags ) {
106 std::string lcaseTagName =
toLower( tagName );
107 auto countIt = tagCounts.find( lcaseTagName );
108 if( countIt == tagCounts.end() )
109 countIt = tagCounts.insert( std::make_pair( lcaseTagName,
TagInfo() ) ).first;
110 countIt->second.add( tagName );
114 for(
auto const& tagCount : tagCounts ) {
116 rss <<
" " << std::setw(2) << tagCount.second.count <<
" ";
117 auto str = rss.
str();
118 auto wrapper =
Column( tagCount.second.all() )
120 .indent( str.size() )
125 return tagCounts.size();
131 std::size_t maxNameLen = 0;
132 for(
auto const& factoryKvp : factories )
133 maxNameLen = (std::max)( maxNameLen, factoryKvp.first.size() );
135 for(
auto const& factoryKvp : factories ) {
137 <<
Column( factoryKvp.first +
":" )
139 .width( 5+maxNameLen )
140 +
Column( factoryKvp.second->getDescription() )
147 return factories.size();
155 if(
config->listTestNamesOnly() )
159 if(
config->listReporters() )
#define CATCH_CONFIG_CONSOLE_WIDTH
T valueOr(T const &defaultValue) const
auto str() const -> std::string
auto indent(size_t newIndent) -> Column &
auto initialIndent(size_t newIndent) -> Column &
std::string stringify(const T &e)
std::vector< TestCase > filterTests(std::vector< TestCase > const &testCases, TestSpec const &testSpec, IConfig const &config)
std::size_t listTags(Config const &config)
std::size_t listReporters()
IRegistryHub const & getRegistryHub()
bool startsWith(std::string const &s, std::string const &prefix)
IMutableContext & getCurrentMutableContext()
std::size_t listTestsNamesOnly(Config const &config)
Option< std::size_t > list(std::shared_ptr< Config > const &config)
std::vector< TestCase > const & getAllTestCasesSorted(IConfig const &config)
std::string toLower(std::string const &s)
std::size_t listTests(Config const &config)
virtual void setConfig(IConfigPtr const &config)=0
virtual IReporterRegistry const & getReporterRegistry() const =0
std::map< std::string, IReporterFactoryPtr > FactoryMap
virtual FactoryMap const & getFactories() const =0
void add(std::string const &spelling)
std::set< std::string > spellings