1
0
Fork 0

tests: Make sure XDG_CURRENT_DESKTOP is unset

GSettings overrides can be active and set the default value depending on
the XDG_CURRENT_DESKTOP environement variable. For the tests we run, we
rely on the default settings by using the GSettings memory backend but
we also need to make sure not overrides are in place.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3730>
This commit is contained in:
Sebastian Wick 2024-05-03 18:09:01 +02:00 committed by Marge Bot
parent 301c154f02
commit 08c9a775e7
4 changed files with 5 additions and 3 deletions

View file

@ -597,8 +597,6 @@ main (int argc,
g_autoptr (MetaContext) context = NULL;
g_autoptr (GError) error = NULL;
g_assert_cmpstr (getenv ("GSETTINGS_BACKEND"), ==, "memory");
context = test_context =
meta_create_test_context (META_CONTEXT_TEST_TYPE_HEADLESS,
META_CONTEXT_TEST_FLAG_NO_X11);

View file

@ -66,6 +66,9 @@ ensure_gsettings_memory_backend (void)
g_autoptr (GSettingsBackend) memory_backend = NULL;
GSettingsBackend *default_backend;
g_assert_cmpstr (getenv ("GSETTINGS_BACKEND"), ==, "memory");
g_assert_cmpstr (getenv ("XDG_CURRENT_DESKTOP"), ==, "");
memory_backend = g_memory_settings_backend_new ();
default_backend = g_settings_backend_get_default ();
g_assert_true (G_TYPE_FROM_INSTANCE (memory_backend) ==

View file

@ -265,6 +265,7 @@ def wrap_call(args, wrapper):
env['NO_AT_BRIDGE'] = '1'
env['GTK_A11Y'] = 'none'
env['GSETTINGS_BACKEND'] = 'memory'
env['XDG_CURRENT_DESKTOP'] = ''
env['META_DBUS_RUNNER_ACTIVE'] = '1'
if wrapper == 'gdb':

View file

@ -4,6 +4,6 @@ Description=Mutter stacking test: @stacking_test@
# a solution for
# https://gitlab.gnome.org/GNOME/gnome-desktop-testing/-/issues/1,
# and anyway that wouldn't be sufficient to handle XDG_RUNTIME_DIR
Exec=sh -ec 'env GSETTINGS_BACKEND=memory XDG_RUNTIME_DIR="$(mktemp -d -t mutter-@apiversion@-@stacking_test@-XXXXXX)" @libexecdir@/installed-tests/mutter-@apiversion@/mutter-installed-dbus-session.py xvfb-run -a -s "+iglx -noreset" -- @libexecdir@/installed-tests/mutter-@apiversion@/mutter-test-runner @tests_datadir@/stacking/@stacking_test@.metatest'
Exec=sh -ec 'env GSETTINGS_BACKEND=memory XDG_CURRENT_DESKTOP= XDG_RUNTIME_DIR="$(mktemp -d -t mutter-@apiversion@-@stacking_test@-XXXXXX)" @libexecdir@/installed-tests/mutter-@apiversion@/mutter-installed-dbus-session.py xvfb-run -a -s "+iglx -noreset" -- @libexecdir@/installed-tests/mutter-@apiversion@/mutter-test-runner @tests_datadir@/stacking/@stacking_test@.metatest'
Type=session
Output=TAP