mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-15 00:36:19 +01:00
gtestutils: skipping a test should count as success, not failure
In particular, the test program as a whole should exit with status 0 if you skipped some tests but did not fail any. https://bugzilla.gnome.org/show_bug.cgi?id=720263
This commit is contained in:
parent
c300079f13
commit
8c188fc9e5
@ -2117,7 +2117,8 @@ test_case_run (GTestCase *tc)
|
|||||||
g_free (test_uri_base);
|
g_free (test_uri_base);
|
||||||
test_uri_base = old_base;
|
test_uri_base = old_base;
|
||||||
|
|
||||||
return success == G_TEST_RUN_SUCCESS;
|
return (success == G_TEST_RUN_SUCCESS ||
|
||||||
|
success == G_TEST_RUN_SKIPPED);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -575,6 +575,12 @@ test_nonfatal (void)
|
|||||||
g_test_trap_assert_stdout ("*The End*");
|
g_test_trap_assert_stdout ("*The End*");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_skip (void)
|
||||||
|
{
|
||||||
|
g_test_skip ("Skipped should count as passed, not failed");
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc,
|
main (int argc,
|
||||||
char *argv[])
|
char *argv[])
|
||||||
@ -633,5 +639,7 @@ main (int argc,
|
|||||||
|
|
||||||
g_test_add_func ("/misc/nonfatal", test_nonfatal);
|
g_test_add_func ("/misc/nonfatal", test_nonfatal);
|
||||||
|
|
||||||
|
g_test_add_func ("/misc/skip", test_skip);
|
||||||
|
|
||||||
return g_test_run();
|
return g_test_run();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user