Commit fa4505e6 by Patrick Steinhardt

tests: config: make sure to clean up after each test

The config::global test suite creates various different directories and
files which are being populated with pretend-global files.
Unfortunately, the tests do not clean up after themselves, which may
cause subsequent tests to fail due to cruft left behind.

Fix this by always removing created directories and their contents.
parent 8e4927a4
......@@ -27,6 +27,9 @@ void test_config_global__initialize(void)
void test_config_global__cleanup(void)
{
cl_sandbox_set_search_path_defaults();
cl_git_pass(git_futils_rmdir_r("home", NULL, GIT_RMDIR_REMOVE_FILES));
cl_git_pass(git_futils_rmdir_r("xdg", NULL, GIT_RMDIR_REMOVE_FILES));
cl_git_pass(git_futils_rmdir_r("etc", NULL, GIT_RMDIR_REMOVE_FILES));
}
void test_config_global__open_global(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment