From 3eceab95f314edb85ee72c047a4acd35e757d037 Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Wed, 1 Mar 2023 09:44:43 -0500 Subject: 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 --- clang/unittests/libclang/LibclangTest.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/unittests/libclang/LibclangTest.cpp') 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() }; -- cgit v1.1