Skip to content

Commit fa4505e

Browse files
committed
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.
1 parent 8e4927a commit fa4505e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/config/global.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ void test_config_global__initialize(void)
2727
void test_config_global__cleanup(void)
2828
{
2929
cl_sandbox_set_search_path_defaults();
30+
cl_git_pass(git_futils_rmdir_r("home", NULL, GIT_RMDIR_REMOVE_FILES));
31+
cl_git_pass(git_futils_rmdir_r("xdg", NULL, GIT_RMDIR_REMOVE_FILES));
32+
cl_git_pass(git_futils_rmdir_r("etc", NULL, GIT_RMDIR_REMOVE_FILES));
3033
}
3134

3235
void test_config_global__open_global(void)

0 commit comments

Comments
 (0)