Added [!mayfail] tag to indicate test case that can fail without failing the suite.

Overhauled the summary report (including the expected failure count)
This commit is contained in:
Phil Nash 2014-07-03 08:09:57 +01:00
parent 05e42cb65c
commit 9c1f9a8f9a
15 changed files with 390 additions and 238 deletions

View file

@ -9,30 +9,34 @@
#define TWOBLUECUBES_CATCH_TOTALS_HPP_INCLUDED
#include <cstddef>
#include <assert.h> // !TBD
namespace Catch {
struct Counts {
Counts() : passed( 0 ), failed( 0 ) {}
Counts() : passed( 0 ), failed( 0 ), failedButOk( 0 ) {}
Counts operator - ( Counts const& other ) const {
Counts diff;
diff.passed = passed - other.passed;
diff.failed = failed - other.failed;
diff.failedButOk = failedButOk - other.failedButOk;
return diff;
}
Counts& operator += ( Counts const& other ) {
passed += other.passed;
failed += other.failed;
failedButOk += other.failedButOk;
return *this;
}
std::size_t total() const {
return passed + failed;
return passed + failed + failedButOk;
}
std::size_t passed;
std::size_t failed;
std::size_t failedButOk;
};
struct Totals {
@ -48,6 +52,8 @@ namespace Catch {
Totals diff = *this - prevTotals;
if( diff.assertions.failed > 0 )
++diff.testCases.failed;
else if( diff.assertions.failedButOk > 0 )
++diff.testCases.failedButOk;
else
++diff.testCases.passed;
return diff;