forked from catchorg/Catch2
Added a delta method to Totals that tracks new passed/ failures
This fixes issue with test group results
This commit is contained in:
@@ -19,6 +19,11 @@ namespace Catch {
|
||||
diff.failed = failed - other.failed;
|
||||
return diff;
|
||||
}
|
||||
Counts& operator += ( const Counts& other ) {
|
||||
passed += other.passed;
|
||||
failed += other.failed;
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::size_t total() const {
|
||||
return passed + failed;
|
||||
@@ -36,6 +41,15 @@ namespace Catch {
|
||||
diff.testCases = testCases - other.testCases;
|
||||
return diff;
|
||||
}
|
||||
|
||||
Totals delta( const Totals& prevTotals ) const {
|
||||
Totals diff = *this - prevTotals;
|
||||
if( diff.assertions.failed > 0 )
|
||||
++diff.testCases.failed;
|
||||
else
|
||||
++diff.testCases.passed;
|
||||
return diff;
|
||||
}
|
||||
|
||||
Counts assertions;
|
||||
Counts testCases;
|
||||
|
||||
Reference in New Issue
Block a user