aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/libclang/LibclangTest.cpp
diff options
context:
space:
mode:
authorIgor Kushnir <igorkuo@gmail.com>2023-03-01 09:44:43 -0500
committerAaron Ballman <aaron@aaronballman.com>2023-03-01 09:45:24 -0500
commit3eceab95f314edb85ee72c047a4acd35e757d037 (patch)
tree9d22dcc502e8cc37a3fddc2ce679ed754294884c /clang/unittests/libclang/LibclangTest.cpp
parent457c4fe3d925c5ffae1da133900fd3a6dad8eb8d (diff)
downloadllvm-3eceab95f314edb85ee72c047a4acd35e757d037.zip
llvm-3eceab95f314edb85ee72c047a4acd35e757d037.tar.gz
llvm-3eceab95f314edb85ee72c047a4acd35e757d037.tar.bz2
LibclangTest: remove libclang-test-* tmp dir reliably
Temporary directories created by two LibclangReparseTest tests - ReparseWithModule and clang_parseTranslationUnit2FullArgv - remained in the system temporary directory after running libclangTests, because not all files and subdirectories created in TestDir were added to set LibclangParseTest::Files. Differential Revision: https://reviews.llvm.org/D143415
Diffstat (limited to 'clang/unittests/libclang/LibclangTest.cpp')
-rw-r--r--clang/unittests/libclang/LibclangTest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/unittests/libclang/LibclangTest.cpp b/clang/unittests/libclang/LibclangTest.cpp
index 809426a..11a729f 100644
--- a/clang/unittests/libclang/LibclangTest.cpp
+++ b/clang/unittests/libclang/LibclangTest.cpp
@@ -515,6 +515,8 @@ TEST_F(LibclangReparseTest, ReparseWithModule) {
WriteFile(HeaderName, std::string(HeaderTop) + HeaderBottom);
WriteFile(ModName, ModFile);
+ // Removing recursively is necessary to delete the module cache.
+ RemoveTestDirRecursivelyDuringTeardown = true;
std::string ModulesCache = std::string("-fmodules-cache-path=") + TestDir;
const char *Args[] = { "-fmodules", ModulesCache.c_str(),
"-I", TestDir.c_str() };