Skip to content

gtestutils: Use $G_TEST_TMPDIR as temporary directory when defined

Marco Trevisan requested to merge 3v1n0/glib:tests-isolated-tmpdir into main
During tests in which we are isolating directories, we may still create
temporary files in the global temporary directory without cleaning them
because the value returned by g_get_tmp_dir() is cached when we isolate
the tests directory to the global TMPDIR.

To ensure that we're always isolating the temporary directories, let's
unset the cached temporary directory once we've defined $G_TEST_TMPDIR
so that the returned value of g_get_tmpdir() can be recomputed using the
test isolated temporary directory.

Merge request reports