[mutter] tests/clutter: Make $DISPLAY non-optional
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] tests/clutter: Make $DISPLAY non-optional
- Date: Thu, 13 Aug 2020 16:00:30 +0000 (UTC)
commit 787bc3d9939bacd744ec614f8798e24ed0fa3a0c
Author: Jonas Ådahl <jadahl gmail com>
Date: Thu Jul 9 19:26:06 2020 +0200
tests/clutter: Make $DISPLAY non-optional
All our tests rely on the nested backend, which runs on top of X11, so
there is no point in having code that tries to handle not finding a
valid $DISPLAY.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
src/tests/clutter-test-utils.c | 37 +++++++------------------------------
1 file changed, 7 insertions(+), 30 deletions(-)
---
diff --git a/src/tests/clutter-test-utils.c b/src/tests/clutter-test-utils.c
index 4f387e2bf0..6f63227358 100644
--- a/src/tests/clutter-test-utils.c
+++ b/src/tests/clutter-test-utils.c
@@ -5,7 +5,7 @@
#include <clutter/clutter.h>
typedef struct {
- guint no_display : 1;
+ gpointer dummy_field;
} ClutterTestEnvironment;
static ClutterTestEnvironment *test_environ = NULL;
@@ -39,33 +39,19 @@ void
clutter_test_init (int *argc,
char ***argv)
{
- gboolean no_display = FALSE;
+ const char *display = g_getenv ("DISPLAY");
if (G_UNLIKELY (test_environ != NULL))
g_error ("Attempting to initialize the test suite more than once, "
"aborting...\n");
-#ifdef CLUTTER_WINDOWING_X11
- /* on X11 backends we need the DISPLAY environment set.
- *
- * check_windowing_backend() will pre-initialize the Clutter
- * backend object.
- */
- if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
+ display = g_getenv ("DISPLAY");
+ if (!display || *display == '\0')
{
- const char *display = g_getenv ("DISPLAY");
-
- if (display == NULL || *display == '\0')
- {
- g_test_message ("No DISPLAY environment variable found, but we require a "
- "DISPLAY set in order to run the conformance test suite.\n"
- "Skipping all tests.\n");
- no_display = TRUE;
-
- goto out;
- }
+ g_error ("No DISPLAY environment variable found, but we require a "
+ "DISPLAY set in order to run the conformance test suite.\n"
+ "Skipping all tests.\n");
}
-#endif
/* we explicitly disable the synchronisation to the vertical refresh
* rate, and run the master clock using a 60 fps timer instead.
@@ -75,13 +61,11 @@ clutter_test_init (int *argc,
/* perform the actual initialization */
g_assert (clutter_init (NULL, NULL) == CLUTTER_INIT_SUCCESS);
-out:
g_test_init (argc, argv, NULL);
g_test_bug_base ("https://bugzilla.gnome.org/show_bug.cgi?id=%s");
/* our global state, accessible from each test unit */
test_environ = g_new0 (ClutterTestEnvironment, 1);
- test_environ->no_display = no_display;
}
/**
@@ -119,12 +103,6 @@ clutter_test_func_wrapper (gconstpointer data_)
stage = clutter_test_get_stage ();
g_assert_false (clutter_actor_is_mapped (stage));
- if (test_environ->no_display)
- {
- g_test_skip ("No DISPLAY set");
- goto out;
- }
-
if (data->test_data != NULL)
{
GTestDataFunc test_func = data->test_func;
@@ -138,7 +116,6 @@ clutter_test_func_wrapper (gconstpointer data_)
test_func ();
}
-out:
if (data->test_notify != NULL)
data->test_notify (data->test_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]