g_test_incomplete() makes test_case_run() return FALSE
g_test_incomplete() prints "ok # TODO" in the TAP output, but is treated as failure by test_case_run(), which eventually makes g_test_run() return a nonzero exit status. There are arguably several related bugs here:
Steps to reproduce: Run glib/tests/date
on a system with no ru_RU
locale
Expected result: test exits 0
Actual result: test exits 1
Steps to reproduce: Run glib/tests/date
on a system with no ru_RU
locale
Expected result: prints not ok 7 /date/month_names # TODO ...
, the TAP encoding for a test that is expected to fail (the spec gives the example not ok 4 - Summarized correctly # TODO Not written yet
)
Actual result: prints ok 7 /date/month_names # TODO ...
, the TAP encoding for a test that is expected to fail but unexpectedly succeeded
Arguably glib/tests/date.c
should also use g_test_skip()
, because the test is being skipped due to circumstances outside GLib's control (the locales on the host system), and not because the functionality of GLib itself is incomplete. If I'm reading its documentation correctly, g_test_incomplete()
could have been used to add a failing test before the alternate month name feature was implemented, for example.