MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / listTests

Function listTests

Bcore/src/main/cpp/Dobby/tests/catch.hpp:7526–7556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7524namespace Catch {
7525
7526std::size_t listTests(Config const &config) {
7527 TestSpec testSpec = config.testSpec();
7528 if (config.hasTestFilters())
7529 Catch::cout() << "Matching test cases:\n";
7530 else {
7531 Catch::cout() << "All available test cases:\n";
7532 }
7533
7534 auto matchedTestCases = filterTests(getAllTestCasesSorted(config), testSpec, config);
7535 for (auto const &testCaseInfo : matchedTestCases) {
7536 Colour::Code colour = testCaseInfo.isHidden() ? Colour::SecondaryText : Colour::None;
7537 Colour colourGuard(colour);
7538
7539 Catch::cout() << Column(testCaseInfo.name).initialIndent(2).indent(4) << "\n";
7540 if (config.verbosity() >= Verbosity::High) {
7541 Catch::cout() << Column(Catch::Detail::stringify(testCaseInfo.lineInfo)).indent(4) << std::endl;
7542 std::string description = testCaseInfo.description;
7543 if (description.empty())
7544 description = "(NO DESCRIPTION)";
7545 Catch::cout() << Column(description).indent(4) << std::endl;
7546 }
7547 if (!testCaseInfo.tags.empty())
7548 Catch::cout() << Column(testCaseInfo.tagsAsString()).indent(6) << "\n";
7549 }
7550
7551 if (!config.hasTestFilters())
7552 Catch::cout() << pluralise(matchedTestCases.size(), "test case") << '\n' << std::endl;
7553 else
7554 Catch::cout() << pluralise(matchedTestCases.size(), "matching test case") << '\n' << std::endl;
7555 return matchedTestCases.size();
7556}
7557
7558std::size_t listTestsNamesOnly(Config const &config) {
7559 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