3291
Stop double-counting failing tests in some situations.
This commit is contained in:
parent
36d74808d9
commit
60c566eaac
|
@ -23,7 +23,7 @@ long Num_failures = 0;
|
|||
|
||||
:(before "End Includes")
|
||||
#define CHECK(X) \
|
||||
if (!(X)) { \
|
||||
if (Passed && !(X)) { \
|
||||
++Num_failures; \
|
||||
cerr << "\nF - " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): " << #X << '\n'; \
|
||||
Passed = false; \
|
||||
|
@ -31,7 +31,7 @@ long Num_failures = 0;
|
|||
}
|
||||
|
||||
#define CHECK_EQ(X, Y) \
|
||||
if ((X) != (Y)) { \
|
||||
if (Passed && (X) != (Y)) { \
|
||||
++Num_failures; \
|
||||
cerr << "\nF - " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): " << #X << " == " << #Y << '\n'; \
|
||||
cerr << " got " << (X) << '\n'; /* BEWARE: multiple eval */ \
|
||||
|
|
|
@ -216,7 +216,7 @@ START_TRACING_UNTIL_END_OF_SCOPE
|
|||
|
||||
#define CHECK_TRACE_CONTAINS_ERROR() CHECK(trace_count("error") > 0)
|
||||
#define CHECK_TRACE_DOESNT_CONTAIN_ERROR() \
|
||||
if (trace_count("error") > 0) { \
|
||||
if (Passed && trace_count("error") > 0) { \
|
||||
++Num_failures; \
|
||||
cerr << "\nF - " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): unexpected errors\n"; \
|
||||
DUMP("error"); \
|
||||
|
@ -225,7 +225,7 @@ START_TRACING_UNTIL_END_OF_SCOPE
|
|||
}
|
||||
|
||||
#define CHECK_TRACE_COUNT(label, count) \
|
||||
if (trace_count(label) != (count)) { \
|
||||
if (Passed && trace_count(label) != (count)) { \
|
||||
++Num_failures; \
|
||||
cerr << "\nF - " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): trace_count of " << label << " should be " << count << '\n'; \
|
||||
cerr << " got " << trace_count(label) << '\n'; /* multiple eval */ \
|
||||
|
@ -238,6 +238,7 @@ START_TRACING_UNTIL_END_OF_SCOPE
|
|||
|
||||
:(code)
|
||||
bool check_trace_contents(string FUNCTION, string FILE, int LINE, string expected) {
|
||||
if (!Passed) return false;
|
||||
if (!Trace_stream) return false;
|
||||
vector<string> expected_lines = split(expected, "");
|
||||
int curr_expected_line = 0;
|
||||
|
|
Loading…
Reference in New Issue