[clang] 2017831 - [clang][Unit Test] Updating Negative Stat Caching Diagnostic Unit Test (#138955)
via cfe-commits
cfe-commits at lists.llvm.org
Thu May 8 08:49:14 PDT 2025
Author: Qiongsi Wu
Date: 2025-05-08T08:49:11-07:00
New Revision: 2017831d449774e792692aac88721e409ba475e4
URL: https://github.com/llvm/llvm-project/commit/2017831d449774e792692aac88721e409ba475e4
DIFF: https://github.com/llvm/llvm-project/commit/2017831d449774e792692aac88721e409ba475e4.diff
LOG: [clang][Unit Test] Updating Negative Stat Caching Diagnostic Unit Test (#138955)
This PR makes a minor modification to make it more stable. The only
change is adding a suffix to the path under test.
rdar://149147920
Added:
Modified:
clang/unittests/Tooling/DependencyScanning/DependencyScanningFilesystemTest.cpp
Removed:
################################################################################
diff --git a/clang/unittests/Tooling/DependencyScanning/DependencyScanningFilesystemTest.cpp b/clang/unittests/Tooling/DependencyScanning/DependencyScanningFilesystemTest.cpp
index 5ea8d02353dc3..aed793785f7b1 100644
--- a/clang/unittests/Tooling/DependencyScanning/DependencyScanningFilesystemTest.cpp
+++ b/clang/unittests/Tooling/DependencyScanning/DependencyScanningFilesystemTest.cpp
@@ -186,12 +186,12 @@ TEST(DependencyScanningFilesystem, DiagnoseStaleStatFailures) {
DependencyScanningFilesystemSharedCache SharedCache;
DependencyScanningWorkerFilesystem DepFS(SharedCache, InMemoryFS);
- bool Path1Exists = DepFS.exists("/path1");
+ bool Path1Exists = DepFS.exists("/path1.suffix");
EXPECT_EQ(Path1Exists, false);
// Adding a file that has been stat-ed,
- InMemoryFS->addFile("/path1", 0, llvm::MemoryBuffer::getMemBuffer(""));
- Path1Exists = DepFS.exists("/path1");
+ InMemoryFS->addFile("/path1.suffix", 0, llvm::MemoryBuffer::getMemBuffer(""));
+ Path1Exists = DepFS.exists("/path1.suffix");
// Due to caching in SharedCache, path1 should not exist in
// DepFS's eyes.
EXPECT_EQ(Path1Exists, false);
@@ -200,5 +200,5 @@ TEST(DependencyScanningFilesystem, DiagnoseStaleStatFailures) {
SharedCache.getInvalidNegativeStatCachedPaths(*InMemoryFS.get());
EXPECT_EQ(InvalidPaths.size(), 1u);
- ASSERT_STREQ("/path1", InvalidPaths[0].str().c_str());
+ ASSERT_STREQ("/path1.suffix", InvalidPaths[0].str().c_str());
}
More information about the cfe-commits
mailing list