Creates a unique temporary directory for each unit test and uses
g_set_user_dirs() to set XDG directories to point into subdirectories of it
for the duration of the unit test. The directory tree is cleaned up after the
test finishes successfully. Note that this doesn’t take effect until
g_test_run() is called, so calls to (for example)
return the system-wide value when made in a test program’s
The following functions will return subdirectories of the temporary directory when this option is used. The specific subdirectory paths in use are not guaranteed to be stable API — always use a getter function to retrieve them.
The subdirectories may not be created by the test harness; as with normal calls to functions like g_get_user_cache_dir(), the caller must be prepared to create the directory if it doesn’t exist.