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

Function listTests

tests/catch.hpp:8902–8934  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8900namespace Catch {
8901
8902 std::size_t listTests( Config const& config ) {
8903 TestSpec testSpec = config.testSpec();
8904 if( config.hasTestFilters() )
8905 Catch::cout() << "Matching test cases:\n";
8906 else {
8907 Catch::cout() << "All available test cases:\n";
8908 }
8909
8910 auto matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
8911 for( auto const& testCaseInfo : matchedTestCases ) {
8912 Colour::Code colour = testCaseInfo.isHidden()
8913 ? Colour::SecondaryText
8914 : Colour::None;
8915 Colour colourGuard( colour );
8916
8917 Catch::cout() << Column( testCaseInfo.name ).initialIndent( 2 ).indent( 4 ) << "\n";
8918 if( config.verbosity() >= Verbosity::High ) {
8919 Catch::cout() << Column( Catch::Detail::stringify( testCaseInfo.lineInfo ) ).indent(4) << std::endl;
8920 std::string description = testCaseInfo.description;
8921 if( description.empty() )
8922 description = "(NO DESCRIPTION)";
8923 Catch::cout() << Column( description ).indent(4) << std::endl;
8924 }
8925 if( !testCaseInfo.tags.empty() )
8926 Catch::cout() << Column( testCaseInfo.tagsAsString() ).indent( 6 ) << "\n";
8927 }
8928
8929 if( !config.hasTestFilters() )
8930 Catch::cout() << pluralise( matchedTestCases.size(), "test case" ) << '\n' << std::endl;
8931 else
8932 Catch::cout() << pluralise( matchedTestCases.size(), "matching test case" ) << '\n' << std::endl;
8933 return matchedTestCases.size();
8934 }
8935
8936 std::size_t listTestsNamesOnly( Config const& config ) {
8937 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
verbosityMethod · 0.80
tagsAsStringMethod · 0.80
sizeMethod · 0.80
indentMethod · 0.45

Tested by

no test coverage detected