mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-31 00:47:56 +00:00
WIldcards at both ends
This commit is contained in:
parent
56d5c42912
commit
4c97fc5619
6 changed files with 141 additions and 66 deletions
|
@ -35,20 +35,25 @@ namespace Catch {
|
|||
|
||||
if( config.listSpec & List::Tests ) {
|
||||
if( config.filters.empty() )
|
||||
std::cout << "All available tests:\n";
|
||||
std::cout << "All available test cases:\n";
|
||||
else
|
||||
std::cout << "Matching tests:\n";
|
||||
std::cout << "Matching test cases:\n";
|
||||
std::vector<TestCaseInfo>::const_iterator it = getRegistryHub().getTestCaseRegistry().getAllTests().begin();
|
||||
std::vector<TestCaseInfo>::const_iterator itEnd = getRegistryHub().getTestCaseRegistry().getAllTests().end();
|
||||
std::size_t matchedTests = 0;
|
||||
for(; it != itEnd; ++it ) {
|
||||
if( matchesFilters( config.filters, *it ) ) {
|
||||
matchedTests++;
|
||||
// !TBD: consider listAs()
|
||||
std::cout << "\t" << it->getName() << "\n";
|
||||
if( ( config.listSpec & List::TestNames ) != List::TestNames )
|
||||
std::cout << "\t\t '" << it->getDescription() << "'\n";
|
||||
}
|
||||
}
|
||||
std::cout << std::endl;
|
||||
if( config.filters.empty() )
|
||||
std::cout << pluralise( matchedTests, "test case" ) << std::endl;
|
||||
else
|
||||
std::cout << pluralise( matchedTests, "matching test case" ) << std::endl;
|
||||
}
|
||||
|
||||
if( ( config.listSpec & List::All ) == 0 ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue