glib/docs
Philip Withnall 13730c27c0 gtestutils: Add XDG directory isolation
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
2018-12-17 17:16:03 +00:00
..
reference gtestutils: Add XDG directory isolation 2018-12-17 17:16:03 +00:00
debugging.txt Remove references to gruntime. This includes renaming the test program 2002-02-26 21:23:52 +00:00
macros.txt build: Remove the --disable-mem-pools build option and the DISABLE_MEM_POOLS macro 2018-06-02 09:45:55 +02:00
Makefile.am Removed obsolete makefile rules 2013-10-17 13:20:14 -04:00