Skip sandbox test if running under X11

This commit is contained in:
Sebastian Ramacher 2023-09-11 19:14:41 +02:00
parent c5f315d712
commit ff53e92665

View file

@ -12,6 +12,17 @@ START_TEST(test_create) {
ck_assert(zathura_init(zathura));
zathura_free(zathura);
} END_TEST
static void
sandbox_setup(void)
{
setup();
#ifdef GDK_WINDOWING_X11
GdkDisplay* display = gdk_display_get_default();
ck_assert_msg(!GDK_IS_X11_DISPLAY(display), "Running under X11.");
#endif
}
static Suite* suite_sandbox(void)
{
@ -20,7 +31,7 @@ static Suite* suite_sandbox(void)
/* basic */
tcase = tcase_create("basic");
tcase_add_checked_fixture(tcase, setup, NULL);
tcase_add_checked_fixture(tcase, sandbox_setup, NULL);
tcase_add_test(tcase, test_create);
suite_add_tcase(suite, tcase);