tests: Create a temporary XDG_DATA_HOME to run each test
This will avoid some tests needing to write to /usr when run as installed-tests. Helps: https://gitlab.gnome.org/GNOME/mutter/-/issues/3658 Signed-off-by: Simon McVittie <smcv@debian.org> Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4012>
This commit is contained in:
parent
d7a5f364c9
commit
642b672b70
1 changed files with 7 additions and 1 deletions
|
@ -424,7 +424,13 @@ def meta_run(klass, extra_env=None, setup_argparse=None, handle_argparse=None):
|
||||||
|
|
||||||
with tempfile.TemporaryDirectory(prefix='mutter-testroot-',
|
with tempfile.TemporaryDirectory(prefix='mutter-testroot-',
|
||||||
ignore_cleanup_errors=True) as test_root:
|
ignore_cleanup_errors=True) as test_root:
|
||||||
env_dirs = ['HOME', 'TMPDIR', 'XDG_RUNTIME_DIR', 'XDG_CONFIG_DIR']
|
env_dirs = [
|
||||||
|
'HOME',
|
||||||
|
'TMPDIR',
|
||||||
|
'XDG_CONFIG_DIR',
|
||||||
|
'XDG_DATA_HOME',
|
||||||
|
'XDG_RUNTIME_DIR',
|
||||||
|
]
|
||||||
os.environ['MUTTER_DBUS_RUNNER_TEST_ROOT'] = test_root
|
os.environ['MUTTER_DBUS_RUNNER_TEST_ROOT'] = test_root
|
||||||
print('Setup MUTTER_DBUS_RUNNER_TEST_ROOT as', test_root, file=sys.stderr)
|
print('Setup MUTTER_DBUS_RUNNER_TEST_ROOT as', test_root, file=sys.stderr)
|
||||||
for env_dir in env_dirs:
|
for env_dir in env_dirs:
|
||||||
|
|
Loading…
Reference in a new issue