| 10480 | } |
| 10481 | |
| 10482 | void defaultListTests(std::ostream& out, ColourImpl* streamColour, std::vector<TestCaseHandle> const& tests, bool isFiltered, Verbosity verbosity) { |
| 10483 | // We special case this to provide the equivalent of old |
| 10484 | // `--list-test-names-only`, which could then be used by the |
| 10485 | // `--input-file` option. |
| 10486 | if (verbosity == Verbosity::Quiet) { |
| 10487 | listTestNamesOnly(out, tests); |
| 10488 | return; |
| 10489 | } |
| 10490 | |
| 10491 | if (isFiltered) { |
| 10492 | out << "Matching test cases:\n"; |
| 10493 | } else { |
| 10494 | out << "All available test cases:\n"; |
| 10495 | } |
| 10496 | |
| 10497 | for (auto const& test : tests) { |
| 10498 | auto const& testCaseInfo = test.getTestCaseInfo(); |
| 10499 | Colour::Code colour = testCaseInfo.isHidden() |
| 10500 | ? Colour::SecondaryText |
| 10501 | : Colour::None; |
| 10502 | auto colourGuard = streamColour->guardColour( colour ).engage( out ); |
| 10503 | |
| 10504 | out << TextFlow::Column(testCaseInfo.name).indent(2) << '\n'; |
| 10505 | if (verbosity >= Verbosity::High) { |
| 10506 | out << TextFlow::Column(Catch::Detail::stringify(testCaseInfo.lineInfo)).indent(4) << '\n'; |
| 10507 | } |
| 10508 | if (!testCaseInfo.tags.empty() && |
| 10509 | verbosity > Verbosity::Quiet) { |
| 10510 | out << TextFlow::Column(testCaseInfo.tagsAsString()).indent(6) << '\n'; |
| 10511 | } |
| 10512 | } |
| 10513 | |
| 10514 | if (isFiltered) { |
| 10515 | out << pluralise(tests.size(), "matching test case"_sr); |
| 10516 | } else { |
| 10517 | out << pluralise(tests.size(), "test case"_sr); |
| 10518 | } |
| 10519 | out << "\n\n" << std::flush; |
| 10520 | } |
| 10521 | |
| 10522 | namespace { |
| 10523 | class SummaryColumn { |
no test coverage detected