tests: always log to file during tests

And set the cachedir (for logging and other things) to a random tmpdir.
This commit is contained in:
Dirk-Jan C. Binnema
2023-04-09 14:43:36 +03:00
parent 9b8a0146e0
commit ec942a988d
2 changed files with 5 additions and 1 deletions

View File

@ -93,7 +93,10 @@ black_hole(void)
void
Mu::mu_test_init(int *argc, char ***argv)
{
const auto tmpdir{test_random_tmpdir()};
g_setenv("MU_TEST", "yes", TRUE);
g_setenv("XDG_CACHE_HOME", tmpdir.c_str(), TRUE);
g_test_init(argc, argv, NULL);