@@ -21,6 +21,7 @@ import TestUtilities
21
21
final class IncrementalCompilationTests : XCTestCase {
22
22
23
23
var tempDir : AbsolutePath = AbsolutePath ( " /tmp " )
24
+ var explicitModuleCacheDir : AbsolutePath = AbsolutePath ( " /tmp/ModuleCache " )
24
25
25
26
var derivedDataDir : AbsolutePath {
26
27
tempDir. appending ( component: " derivedData " )
@@ -64,8 +65,8 @@ final class IncrementalCompilationTests: XCTestCase {
64
65
[
65
66
" swiftc " ,
66
67
" -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 ) ,
69
70
" -driver-show-incremental " ,
70
71
" -driver-show-job-lifecycle " ,
71
72
" -enable-batch-mode " ,
@@ -74,10 +75,11 @@ final class IncrementalCompilationTests: XCTestCase {
74
75
" -incremental " ,
75
76
" -no-color-diagnostics " ,
76
77
]
77
- + inputPathsAndContents. map { $0. 0 . pathString } . sorted ( )
78
+ + inputPathsAndContents. map { $0. 0 . nativePathString ( escaped : true ) } . sorted ( )
78
79
}
79
80
var explicitBuildArgs : [ String ] {
80
81
[ " -explicit-module-build " ,
82
+ " -module-cache-path " , explicitModuleCacheDir. nativePathString ( escaped: true ) ,
81
83
// Disable implicit imports to keep tests simpler
82
84
" -Xfrontend " , " -disable-implicit-concurrency-module-import " ,
83
85
" -Xfrontend " , " -disable-implicit-string-processing-module-import " ,
@@ -87,6 +89,7 @@ final class IncrementalCompilationTests: XCTestCase {
87
89
88
90
override func setUp( ) {
89
91
self . tempDir = try ! withTemporaryDirectory ( removeTreeOnDeinit: false ) { $0}
92
+ self . explicitModuleCacheDir = tempDir. appending ( component: " ModuleCache " )
90
93
try ! localFileSystem. createDirectory ( derivedDataPath)
91
94
OutputFileMapCreator . write ( module: module,
92
95
inputPaths: inputPathsAndContents. map { $0. 0 } ,
0 commit comments