From 6d8c93ba66590fe7d58d51dda1fdd70574b05ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 14 Jun 2024 21:49:57 +0200 Subject: [PATCH] tests: Mark some tests as skippable Wayland tests also get kvm and tty test variants, but running tty tests on your main session makes them fail. The intention for tty tests is to skip when not run from a tty, so fix that. Part-of: --- src/tests/wayland-fullscreen-test.c | 8 +++++++- src/tests/wayland-unit-tests.c | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/tests/wayland-fullscreen-test.c b/src/tests/wayland-fullscreen-test.c index aea335de7..3c10949c6 100644 --- a/src/tests/wayland-fullscreen-test.c +++ b/src/tests/wayland-fullscreen-test.c @@ -231,6 +231,7 @@ main (int argc, char *argv[]) { g_autoptr (MetaContext) context = NULL; + MetaTestRunFlags test_run_flags; #ifdef MUTTER_PRIVILEGED_TEST context = meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS, @@ -250,6 +251,11 @@ main (int argc, g_signal_connect (context, "after-tests", G_CALLBACK (on_after_tests), NULL); +#ifdef MUTTER_PRIVILEGED_TEST + test_run_flags = META_TEST_RUN_FLAG_CAN_SKIP; +#else + test_run_flags = META_TEST_RUN_FLAG_NONE; +#endif return meta_context_test_run_tests (META_CONTEXT_TEST (context), - META_TEST_RUN_FLAG_NONE); + test_run_flags); } diff --git a/src/tests/wayland-unit-tests.c b/src/tests/wayland-unit-tests.c index 7e5062ca1..b9d9cf5bd 100644 --- a/src/tests/wayland-unit-tests.c +++ b/src/tests/wayland-unit-tests.c @@ -1052,6 +1052,7 @@ main (int argc, char *argv[]) { g_autoptr (MetaContext) context = NULL; + MetaTestRunFlags test_run_flags; #ifdef MUTTER_PRIVILEGED_TEST context = meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS, @@ -1071,6 +1072,11 @@ main (int argc, g_signal_connect (context, "after-tests", G_CALLBACK (on_after_tests), NULL); +#ifdef MUTTER_PRIVILEGED_TEST + test_run_flags = META_TEST_RUN_FLAG_CAN_SKIP; +#else + test_run_flags = META_TEST_RUN_FLAG_NONE; +#endif return meta_context_test_run_tests (META_CONTEXT_TEST (context), - META_TEST_RUN_FLAG_NONE); + test_run_flags); }