mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56:14 +01:00
testutils: Treat incomplete tests more like skipped tests
If a test is marked with g_test_incomplete(), then it is expected to fail, so when it fails the test executable should still exit 0 (or possibly 77, if all tests are either skipped or incomplete). Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
ba3b442152
commit
bbefa73997
@ -990,7 +990,7 @@ g_test_log (GTestLogType lbit,
|
||||
g_print ("Bail out!\n");
|
||||
g_abort ();
|
||||
}
|
||||
if (result == G_TEST_RUN_SKIPPED)
|
||||
if (result == G_TEST_RUN_SKIPPED || result == G_TEST_RUN_INCOMPLETE)
|
||||
test_skipped_count++;
|
||||
break;
|
||||
case G_TEST_LOG_MIN_RESULT:
|
||||
@ -2338,7 +2338,8 @@ test_case_run (GTestCase *tc)
|
||||
test_uri_base = old_base;
|
||||
|
||||
return (success == G_TEST_RUN_SUCCESS ||
|
||||
success == G_TEST_RUN_SKIPPED);
|
||||
success == G_TEST_RUN_SKIPPED ||
|
||||
success == G_TEST_RUN_INCOMPLETE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -660,6 +660,11 @@ test_incomplete (void)
|
||||
return;
|
||||
}
|
||||
g_test_trap_subprocess (NULL, 0, 0);
|
||||
/* An incomplete test represents functionality that is known not to be
|
||||
* implemented yet (an expected failure), so it does not cause test
|
||||
* failure; but it does count as the test having been skipped, which
|
||||
* causes nonzero exit status 77, which is treated as failure by
|
||||
* g_test_trap_subprocess(). */
|
||||
g_test_trap_assert_failed ();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user