diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-11 09:12:16 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-11 09:14:16 +0100 |
commit | bd3d9ef3d1dbc5364e79e6afb47d9e124cb61ca4 (patch) | |
tree | a7c28421bab79a312d60ec7273a593e85572dd8b /test/cairo-test.c | |
parent | eeafeebd2ec8ad8a9e7053aaaa0f845b58563b3b (diff) |
test: Distinguish tests that throw an error from a normal fail.
Hitting an error in a test case is almost as bad as crashing, and the
severity may be lost amidst "normal" failures. So introduce a new class
of ERROR so that we can immediately spot these during a test run, and
appropriately log them afterwards.
Diffstat (limited to 'test/cairo-test.c')
-rw-r--r-- | test/cairo-test.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/cairo-test.c b/test/cairo-test.c index aa8dd3a60..af4487a57 100644 --- a/test/cairo-test.c +++ b/test/cairo-test.c @@ -1444,7 +1444,7 @@ REPEAT: if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) { cairo_test_log (ctx, "Error: Function under test left cairo status in an error state: %s\n", cairo_status_to_string (cairo_status (cr))); - ret = CAIRO_TEST_FAILURE; + ret = CAIRO_TEST_ERROR; goto UNWIND_CAIRO; } @@ -1665,6 +1665,21 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx, fail_face, normal_face); break; + case CAIRO_TEST_ERROR: + if (print_fail_on_stdout && ctx->thread == 0) { + printf ("!!!ERROR!!!\n"); + } else { + /* eat the test name */ + printf ("\r"); + fflush (stdout); + } + cairo_test_log (ctx, "ERROR\n"); + fprintf (stderr, "%s.%s.%s [%d]%s:\t%s!!!ERROR!!!%s\n", + ctx->test_name, target->name, + cairo_boilerplate_content_name (target->content), dev_offset, similar ? " (similar)" : "", + fail_face, normal_face); + break; + case CAIRO_TEST_XFAILURE: if (print_fail_on_stdout && ctx->thread == 0) { printf ("XFAIL\n"); @@ -1732,6 +1747,9 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx, case CAIRO_TEST_CRASHED: printf ("!!!CRASHED!!!\n"); break; + case CAIRO_TEST_ERROR: + printf ("!!!ERRORED!!!\n"); + break; case CAIRO_TEST_XFAILURE: printf ("XFAIL\n"); break; |