Skip to content

Commit bbc1dec

Browse files
[TEST-ONLY] Fix a caching test regression introduced in #788
rdar://161100596
1 parent 7b44829 commit bbc1dec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/SWBBuildSystemTests/ClangCompilationCachingTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ fileprivate struct ClangCompilationCachingTests: CoreBasedTests {
243243
func readMetrics(_ suffix: String) throws -> String {
244244
try tester.fs.read(tmpDirPath.join("Test/aProject/build/XCBuildData/metrics-\(suffix).json")).asString
245245
}
246-
#expect(try readMetrics("one") == #"{"global":{"clangCacheHits":0,"clangCacheMisses":1,"swiftCacheHits":0,"swiftCacheMisses":0},"tasks":{"CompileC":{"cacheMisses":1}}}"#)
246+
#expect(try readMetrics("one") == #"{"global":{"clangCacheHits":0,"clangCacheMisses":1,"swiftCacheHits":0,"swiftCacheMisses":0},"tasks":{"CompileC":{"cacheMisses":1,"headerDependenciesNotValidatedTasks":1,"moduleDependenciesNotValidatedTasks":1}}}"#)
247247

248248
// Touch the source file to trigger a new scan.
249249
try await tester.fs.updateTimestamp(testWorkspace.sourceRoot.join("aProject/file.c"))
@@ -268,7 +268,7 @@ fileprivate struct ClangCompilationCachingTests: CoreBasedTests {
268268
}
269269
results.checkNoDiagnostics()
270270
}
271-
#expect(try readMetrics("two") == #"{"global":{"clangCacheHits":1,"clangCacheMisses":0,"swiftCacheHits":0,"swiftCacheMisses":0},"tasks":{"CompileC":{"cacheHits":1}}}"#)
271+
#expect(try readMetrics("two") == #"{"global":{"clangCacheHits":1,"clangCacheMisses":0,"swiftCacheHits":0,"swiftCacheMisses":0},"tasks":{"CompileC":{"cacheHits":1,"headerDependenciesNotValidatedTasks":1,"moduleDependenciesNotValidatedTasks":1}}}"#)
272272

273273
// Modify the source file to trigger a cache miss.
274274
try await tester.fs.writeFileContents(testWorkspace.sourceRoot.join("aProject/file.c")) { stream in
@@ -288,7 +288,7 @@ fileprivate struct ClangCompilationCachingTests: CoreBasedTests {
288288
results.checkCompileCacheMiss(compileTask)
289289
results.checkNoDiagnostics()
290290
}
291-
#expect(try readMetrics("three") == #"{"global":{"clangCacheHits":0,"clangCacheMisses":1,"swiftCacheHits":0,"swiftCacheMisses":0},"tasks":{"CompileC":{"cacheMisses":1}}}"#)
291+
#expect(try readMetrics("three") == #"{"global":{"clangCacheHits":0,"clangCacheMisses":1,"swiftCacheHits":0,"swiftCacheMisses":0},"tasks":{"CompileC":{"cacheMisses":1,"headerDependenciesNotValidatedTasks":1,"moduleDependenciesNotValidatedTasks":1}}}"#)
292292

293293
// Return to the original source -> should still be a hit.
294294
try await tester.fs.writeFileContents(testWorkspace.sourceRoot.join("aProject/file.c")) { stream in
@@ -308,7 +308,7 @@ fileprivate struct ClangCompilationCachingTests: CoreBasedTests {
308308
results.checkCompileCacheHit(compileTask)
309309
results.checkNoDiagnostics()
310310
}
311-
#expect(try readMetrics("four") == #"{"global":{"clangCacheHits":1,"clangCacheMisses":0,"swiftCacheHits":0,"swiftCacheMisses":0},"tasks":{"CompileC":{"cacheHits":1}}}"#)
311+
#expect(try readMetrics("four") == #"{"global":{"clangCacheHits":1,"clangCacheMisses":0,"swiftCacheHits":0,"swiftCacheMisses":0},"tasks":{"CompileC":{"cacheHits":1,"headerDependenciesNotValidatedTasks":1,"moduleDependenciesNotValidatedTasks":1}}}"#)
312312

313313
// The cache should normally persist after the build.
314314
#expect(tester.fs.exists(tmpDirPath.join("CompilationCache")))

0 commit comments

Comments
 (0)