MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / listTests

Function listTests

extern/Catch2/catch.hpp:11255–11287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

listFunction · 0.85

Calls 13

filterTestsFunction · 0.85
ColumnClass · 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
indentMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected