mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-27 23:19:32 +00:00
Refactored internal interfaces to use Totals instead of success/ fail
This commit is contained in:
parent
8d93949b19
commit
9bbaeba3ae
7 changed files with 43 additions and 45 deletions
|
@ -57,7 +57,7 @@ namespace Catch
|
|||
{
|
||||
config.getReporter()->StartGroup( "" );
|
||||
runner.runAll();
|
||||
config.getReporter()->EndGroup( "", runner.getSuccessCount(), runner.getFailureCount() );
|
||||
config.getReporter()->EndGroup( "", runner.getTotals().assertions.passed, runner.getTotals().assertions.failed );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -67,19 +67,19 @@ namespace Catch
|
|||
std::vector<std::string>::const_iterator itEnd = config.getTestSpecs().end();
|
||||
for(; it != itEnd; ++it )
|
||||
{
|
||||
size_t prevSuccess = runner.getSuccessCount();
|
||||
size_t prevFail = runner.getFailureCount();
|
||||
Totals prevTotals = runner.getTotals();
|
||||
config.getReporter()->StartGroup( *it );
|
||||
if( runner.runMatching( *it ) == 0 )
|
||||
{
|
||||
// Use reporter?
|
||||
// std::cerr << "\n[Unable to match any test cases with: " << *it << "]" << std::endl;
|
||||
}
|
||||
config.getReporter()->EndGroup( *it, runner.getSuccessCount()-prevSuccess, runner.getFailureCount()-prevFail );
|
||||
Totals diffTotals = runner.getTotals() - prevTotals;
|
||||
config.getReporter()->EndGroup( *it, diffTotals.assertions.passed, diffTotals.assertions.failed );
|
||||
}
|
||||
}
|
||||
|
||||
return static_cast<int>( runner.getFailureCount() );
|
||||
return static_cast<int>( runner.getTotals().assertions.failed );
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue