mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-11 20:06:18 +01:00
13730c27c0
Add a new G_TEST_OPTIONS_ISOLATE_XDG_DIRS option for g_test_init() which automatically creates a temporary set of XDG directories, and a temporary home directory, and overrides the g_get_user_data_dir() (etc.) functions for the duration of the unit test with the temporary values. This is intended to better isolate unit tests from the user’s actual data and home directory. It works with g_test_subprocess(), but does not work with subprocesses spawned manually by the test — each unit test’s code will need to be amended to correctly set the XDG_* environment variables in the environment of any spawned subprocess. “Why not solve that by setting the XDG environment variables for the whole unit test process tree?” I hear you say. Setting environment variables is not thread safe and they would need to be re-set for each unit test, once worker threads have potentially been spawned. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://gitlab.gnome.org/GNOME/glib/issues/538 |
||
---|---|---|
.. | ||
gio | ||
glib | ||
gobject | ||
.gitignore | ||
AUTHORS | ||
COPYING | ||
Makefile.am | ||
NEWS |