mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56:14 +01:00
testutils: Correctly print incomplete tests as "not ok # TODO"
The TAP specification says that failing tests that are currently expected to fail (like Automake's XFAIL) are to be reported as "not ok", with that failure ignored as a result of the TODO directive, with this example: not ok 3 - infinite loop # TODO halting problem unsolved A test reported as "ok # TODO" indicates that something that is expected to fail has unexpectedly succeeded, similar to Automake's XPASS. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
516101c702
commit
7cc5565e7c
@ -959,7 +959,20 @@ g_test_log (GTestLogType lbit,
|
||||
fail = result == G_TEST_RUN_FAILURE;
|
||||
if (test_tap_log)
|
||||
{
|
||||
g_print ("%s %d %s", fail ? "not ok" : "ok", test_run_count, string1);
|
||||
const gchar *ok;
|
||||
|
||||
/* The TAP representation for an expected failure starts with
|
||||
* "not ok", even though it does not actually count as failing
|
||||
* due to the use of the TODO directive. "ok # TODO" would mean
|
||||
* a test that was expected to fail unexpectedly succeeded,
|
||||
* for which GTestResult does not currently have a
|
||||
* representation. */
|
||||
if (fail || result == G_TEST_RUN_INCOMPLETE)
|
||||
ok = "not ok";
|
||||
else
|
||||
ok = "ok";
|
||||
|
||||
g_print ("%s %d %s", ok, test_run_count, string1);
|
||||
if (result == G_TEST_RUN_INCOMPLETE)
|
||||
g_print (" # TODO %s\n", string2 ? string2 : "");
|
||||
else if (result == G_TEST_RUN_SKIPPED)
|
||||
|
Loading…
Reference in New Issue
Block a user