Let’s say I have something like this:
#include <glib.h>
#include <locale.h>
static void
test_xfail ()
{
g_critical ("This should output a critical, but still not fail the test");
/* This should be nonfatal even though it fails. */
g_assert_cmpint (1, ==, 0);
}
int
main(int argc, char * argv[])
{
setlocale (LC_ALL, "");
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/xfail", test_xfail);
return g_test_run ();
}
A critical and an assertion in a test. Assume it’s flaky and almost always you don’t hit these and the test passes. Is it possible to mark this test somehow as expected or “OK” to fail? g_test_incomplete()
looks like it might be this but it’s not.
Or is my best option to move it out to its own .c
file and have the people running the test ignore failures for that suite?