@@ -1576,10 +1576,10 @@ fileprivate struct ClangCompilationCachingTests: CoreBasedTests {
1576
1576
XCTAssertMatch ( output. stringValue, . contains( #"-isysroot /\^sdk"# ) )
1577
1577
XCTAssertMatch ( output. stringValue, . contains( #"-resource-dir /\^toolchain/usr/lib/clang/"# ) )
1578
1578
}
1579
- func checkModuleCommandLine( task: Task , results: BuildOperationTester . BuildResults , name: String ) {
1579
+ func checkModuleCommandLine( task: Task , results: BuildOperationTester . BuildResults , name: String ) throws {
1580
1580
// The final command-line is only known to the dynamic task, but it's printed to output so we can check that.
1581
- results. checkTaskOutput ( task) { output in
1582
- XCTAssertMatch ( output. stringValue, . contains( #" \#( name) \=/\^mod"# ) )
1581
+ try results. checkTaskOutput ( task) { output in
1582
+ XCTAssertMatch ( output. stringValue, . or ( . contains( #" \#( name) \=/\^mod"# ) , . contains ( #" \#( name ) /\^mod"# ) ) )
1583
1583
checkCommandLineCommon ( output: output)
1584
1584
}
1585
1585
}
@@ -1596,7 +1596,7 @@ fileprivate struct ClangCompilationCachingTests: CoreBasedTests {
1596
1596
results. checkCompileCacheMiss ( moduleTask)
1597
1597
results. checkCompileCacheMiss ( tuTask)
1598
1598
results. checkNoDiagnostics ( )
1599
- checkModuleCommandLine ( task: moduleTask, results: results, name: " Mod1 " )
1599
+ try checkModuleCommandLine ( task: moduleTask, results: results, name: " Mod1 " )
1600
1600
checkTUCommandLine ( task: tuTask, results: results)
1601
1601
}
1602
1602
@@ -1607,7 +1607,7 @@ fileprivate struct ClangCompilationCachingTests: CoreBasedTests {
1607
1607
results. checkCompileCacheHit ( moduleTask)
1608
1608
results. checkCompileCacheHit ( tuTask)
1609
1609
results. checkNoDiagnostics ( )
1610
- checkModuleCommandLine ( task: moduleTask, results: results, name: " Mod2 " )
1610
+ try checkModuleCommandLine ( task: moduleTask, results: results, name: " Mod2 " )
1611
1611
checkTUCommandLine ( task: tuTask, results: results)
1612
1612
}
1613
1613
}
@@ -1842,6 +1842,7 @@ fileprivate struct ClangCompilationCachingTests: CoreBasedTests {
1842
1842
" CLANG_ENABLE_COMPILE_CACHE " : enableCaching ? " YES " : " NO " ,
1843
1843
" CLANG_ENABLE_MODULES " : " NO " ,
1844
1844
" COMPILATION_CACHE_CAS_PATH " : casPath. str,
1845
+ " DSTROOT " : tmpDirPath. join ( " dstroot " ) . str,
1845
1846
]
1846
1847
if usePlugin {
1847
1848
buildSettings [ " COMPILATION_CACHE_ENABLE_PLUGIN " ] = " YES "
@@ -1966,7 +1967,11 @@ fileprivate struct ClangCompilationCachingTests: CoreBasedTests {
1966
1967
// Ignore output for plugin CAS since it may not yet support validation.
1967
1968
try await checkBuild ( " validated successfully \n " )
1968
1969
// Create an error and trigger revalidation by messing with the validation data.
1969
- try tester. fs. move ( casPath. join ( " builtin/v1.1/v8.data " ) , to: casPath. join ( " builtin/v1.1/v8.data.moved " ) )
1970
+ let dataDir = casPath. join ( " builtin " ) . join ( " v1.1 " )
1971
+ let dataFile = try #require( tester. fs. listdir ( dataDir) . first {
1972
+ $0. hasSuffix ( " .data " ) && $0. hasPrefix ( " v " )
1973
+ } )
1974
+ try tester. fs. move ( dataDir. join ( dataFile) , to: dataDir. join ( " moved " ) )
1970
1975
try await tester. fs. writeFileContents ( casPath. join ( " builtin/v1.validation " ) ) { stream in
1971
1976
stream <<< " 0 "
1972
1977
}
0 commit comments