MCPcopy Create free account
hub / github.com/apache/trafficserver / listTests

Function listTests

lib/catch2/catch.hpp:11257–11289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11255namespace Catch {
11256
11257 std::size_t listTests( Config const& config ) {
11258 TestSpec const& testSpec = config.testSpec();
11259 if( config.hasTestFilters() )
11260 Catch::cout() << "Matching test cases:\n";
11261 else {
11262 Catch::cout() << "All available test cases:\n";
11263 }
11264
11265 auto matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
11266 for( auto const& testCaseInfo : matchedTestCases ) {
11267 Colour::Code colour = testCaseInfo.isHidden()
11268 ? Colour::SecondaryText
11269 : Colour::None;
11270 Colour colourGuard( colour );
11271
11272 Catch::cout() << Column( testCaseInfo.name ).initialIndent( 2 ).indent( 4 ) << "\n";
11273 if( config.verbosity() >= Verbosity::High ) {
11274 Catch::cout() << Column( Catch::Detail::stringify( testCaseInfo.lineInfo ) ).indent(4) << std::endl;
11275 std::string description = testCaseInfo.description;
11276 if( description.empty() )
11277 description = "(NO DESCRIPTION)";
11278 Catch::cout() << Column( description ).indent(4) << std::endl;
11279 }
11280 if( !testCaseInfo.tags.empty() )
11281 Catch::cout() << Column( testCaseInfo.tagsAsString() ).indent( 6 ) << "\n";
11282 }
11283
11284 if( !config.hasTestFilters() )
11285 Catch::cout() << pluralise( matchedTestCases.size(), "test case" ) << '\n' << std::endl;
11286 else
11287 Catch::cout() << pluralise( matchedTestCases.size(), "matching test case" ) << '\n' << std::endl;
11288 return matchedTestCases.size();
11289 }
11290
11291 std::size_t listTestsNamesOnly( Config const& config ) {
11292 TestSpec const& testSpec = config.testSpec();

Callers 1

listFunction · 0.85

Calls 13

filterTestsFunction · 0.85
stringifyFunction · 0.85
pluraliseClass · 0.85
testSpecMethod · 0.80
hasTestFiltersMethod · 0.80
isHiddenMethod · 0.80
initialIndentMethod · 0.80
verbosityMethod · 0.80
tagsAsStringMethod · 0.80
ColumnClass · 0.70
indentMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected