mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-25 22:19:25 +00:00
Separated getting test cases to run from running them
This commit is contained in:
parent
d0a5461add
commit
c1dbc9c22b
9 changed files with 92 additions and 80 deletions
|
@ -83,22 +83,22 @@ namespace Catch {
|
|||
{
|
||||
Runner runner( configWrapper, reporter );
|
||||
|
||||
Totals totals;
|
||||
// Run test specs specified on the command line - or default to all
|
||||
if( config.testSpecs.empty() ) {
|
||||
runner.runAll();
|
||||
totals = runner.runAllNonHidden();
|
||||
}
|
||||
else {
|
||||
// !TBD We should get all the testcases upfront, report any missing,
|
||||
// then just run them
|
||||
std::vector<std::string>::const_iterator it = config.testSpecs.begin();
|
||||
std::vector<std::string>::const_iterator itEnd = config.testSpecs.end();
|
||||
for(; it != itEnd; ++it ) {
|
||||
if( runner.runMatching( *it ) == 0 ) {
|
||||
Totals groupTotals = runner.runMatching( *it );
|
||||
if( groupTotals.testCases.total() == 0 )
|
||||
std::cerr << "\n[No test cases matched with: " << *it << "]" << std::endl;
|
||||
}
|
||||
totals += groupTotals;
|
||||
}
|
||||
}
|
||||
result = static_cast<int>( runner.getTotals().assertions.failed );
|
||||
result = static_cast<int>( totals.assertions.failed );
|
||||
}
|
||||
Catch::cleanUp();
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue