MCPcopy Create free account
hub / github.com/RenderKit/embree / listTests

Function listTests

tutorials/external/catch.hpp:9128–9160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9126namespace Catch {
9127
9128 std::size_t listTests( Config const& config ) {
9129 TestSpec testSpec = config.testSpec();
9130 if( config.hasTestFilters() )
9131 Catch::cout() << "Matching test cases:\n";
9132 else {
9133 Catch::cout() << "All available test cases:\n";
9134 }
9135
9136 auto matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
9137 for( auto const& testCaseInfo : matchedTestCases ) {
9138 Colour::Code colour = testCaseInfo.isHidden()
9139 ? Colour::SecondaryText
9140 : Colour::None;
9141 Colour colourGuard( colour );
9142
9143 Catch::cout() << Column( testCaseInfo.name ).initialIndent( 2 ).indent( 4 ) << "\n";
9144 if( config.verbosity() >= Verbosity::High ) {
9145 Catch::cout() << Column( Catch::Detail::stringify( testCaseInfo.lineInfo ) ).indent(4) << std::endl;
9146 std::string description = testCaseInfo.description;
9147 if( description.empty() )
9148 description = "(NO DESCRIPTION)";
9149 Catch::cout() << Column( description ).indent(4) << std::endl;
9150 }
9151 if( !testCaseInfo.tags.empty() )
9152 Catch::cout() << Column( testCaseInfo.tagsAsString() ).indent( 6 ) << "\n";
9153 }
9154
9155 if( !config.hasTestFilters() )
9156 Catch::cout() << pluralise( matchedTestCases.size(), "test case" ) << '\n' << std::endl;
9157 else
9158 Catch::cout() << pluralise( matchedTestCases.size(), "matching test case" ) << '\n' << std::endl;
9159 return matchedTestCases.size();
9160 }
9161
9162 std::size_t listTestsNamesOnly( Config const& config ) {
9163 TestSpec 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
tagsAsStringMethod · 0.80
indentMethod · 0.45
verbosityMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected