MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / listTests

Function listTests

extlibs/catch/include/catch/catch.hpp:10834–10866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10832namespace Catch {
10833
10834 std::size_t listTests( Config const& config ) {
10835 TestSpec testSpec = config.testSpec();
10836 if( config.hasTestFilters() )
10837 Catch::cout() << "Matching test cases:\n";
10838 else {
10839 Catch::cout() << "All available test cases:\n";
10840 }
10841
10842 auto matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
10843 for( auto const& testCaseInfo : matchedTestCases ) {
10844 Colour::Code colour = testCaseInfo.isHidden()
10845 ? Colour::SecondaryText
10846 : Colour::None;
10847 Colour colourGuard( colour );
10848
10849 Catch::cout() << Column( testCaseInfo.name ).initialIndent( 2 ).indent( 4 ) << "\n";
10850 if( config.verbosity() >= Verbosity::High ) {
10851 Catch::cout() << Column( Catch::Detail::stringify( testCaseInfo.lineInfo ) ).indent(4) << std::endl;
10852 std::string description = testCaseInfo.description;
10853 if( description.empty() )
10854 description = "(NO DESCRIPTION)";
10855 Catch::cout() << Column( description ).indent(4) << std::endl;
10856 }
10857 if( !testCaseInfo.tags.empty() )
10858 Catch::cout() << Column( testCaseInfo.tagsAsString() ).indent( 6 ) << "\n";
10859 }
10860
10861 if( !config.hasTestFilters() )
10862 Catch::cout() << pluralise( matchedTestCases.size(), "test case" ) << '\n' << std::endl;
10863 else
10864 Catch::cout() << pluralise( matchedTestCases.size(), "matching test case" ) << '\n' << std::endl;
10865 return matchedTestCases.size();
10866 }
10867
10868 std::size_t listTestsNamesOnly( Config const& config ) {
10869 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
indentMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected