From ff53e92665467baa349e7276b1d32c5e46bd884c Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 11 Sep 2023 19:14:41 +0200 Subject: [PATCH] Skip sandbox test if running under X11 --- tests/test_sandbox.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/test_sandbox.c b/tests/test_sandbox.c index 40246d8..90acdc1 100644 --- a/tests/test_sandbox.c +++ b/tests/test_sandbox.c @@ -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);