@@ -21,6 +21,7 @@ import TestUtilities
2121final class IncrementalCompilationTests : XCTestCase {
2222
2323 var tempDir : AbsolutePath = AbsolutePath ( " /tmp " )
24+ var explicitModuleCacheDir : AbsolutePath = AbsolutePath ( " /tmp/ModuleCache " )
2425
2526 var derivedDataDir : AbsolutePath {
2627 tempDir. appending ( component: " derivedData " )
@@ -64,8 +65,8 @@ final class IncrementalCompilationTests: XCTestCase {
6465 [
6566 " swiftc " ,
6667 " -module-name " , module,
67- " -o " , derivedDataPath. appending ( component: module + " .o " ) . pathString ,
68- " -output-file-map " , OFM . pathString ,
68+ " -o " , derivedDataPath. appending ( component: module + " .o " ) . nativePathString ( escaped : true ) ,
69+ " -output-file-map " , OFM . nativePathString ( escaped : true ) ,
6970 " -driver-show-incremental " ,
7071 " -driver-show-job-lifecycle " ,
7172 " -enable-batch-mode " ,
@@ -74,10 +75,11 @@ final class IncrementalCompilationTests: XCTestCase {
7475 " -incremental " ,
7576 " -no-color-diagnostics " ,
7677 ]
77- + inputPathsAndContents. map { $0. 0 . pathString } . sorted ( )
78+ + inputPathsAndContents. map { $0. 0 . nativePathString ( escaped : true ) } . sorted ( )
7879 }
7980 var explicitBuildArgs : [ String ] {
8081 [ " -explicit-module-build " ,
82+ " -module-cache-path " , explicitModuleCacheDir. nativePathString ( escaped: true ) ,
8183 // Disable implicit imports to keep tests simpler
8284 " -Xfrontend " , " -disable-implicit-concurrency-module-import " ,
8385 " -Xfrontend " , " -disable-implicit-string-processing-module-import " ,
@@ -87,6 +89,7 @@ final class IncrementalCompilationTests: XCTestCase {
8789
8890 override func setUp( ) {
8991 self . tempDir = try ! withTemporaryDirectory ( removeTreeOnDeinit: false ) { $0}
92+ self . explicitModuleCacheDir = tempDir. appending ( component: " ModuleCache " )
9093 try ! localFileSystem. createDirectory ( derivedDataPath)
9194 OutputFileMapCreator . write ( module: module,
9295 inputPaths: inputPathsAndContents. map { $0. 0 } ,
0 commit comments