@@ -188,15 +188,17 @@ import CRT
188188 try localFileSystem. createSymbolicLink ( customSwiftFrontend, pointingAt: defaultSwiftFrontend, relative: false )
189189
190190 try withTemporaryDirectory { tempDirectory in
191+ let fs = TestLocalFileSystem ( cwd: tempDirectory)
191192 let anotherSwiftFrontend = tempDirectory. appending ( component: executableName ( " swift-frontend " ) )
192- try localFileSystem . createSymbolicLink ( anotherSwiftFrontend, pointingAt: defaultSwiftFrontend, relative: false )
193+ try fs . createSymbolicLink ( anotherSwiftFrontend, pointingAt: defaultSwiftFrontend, relative: false )
193194
194195 // test if SWIFT_DRIVER_TOOLNAME_EXEC is respected
195196 do {
196197 var driver = try Driver . forTesting ( args: [ " swiftc " , " -print-target-info " ] ,
197198 env: [ PATH: ProcessEnv . path!,
198199 SWIFT_FRONTEND_EXEC: customSwiftFrontend. pathString,
199- SWIFT_SCANNER_LIB: customSwiftScan. pathString] )
200+ SWIFT_SCANNER_LIB: customSwiftScan. pathString] ,
201+ fileSystem: fs)
200202 let jobs = try driver. planBuild ( )
201203 #expect( jobs. count == 1 )
202204 expectEqual ( jobs. first!. tool. name, customSwiftFrontend. pathString)
@@ -205,7 +207,8 @@ import CRT
205207 // test if tools directory is respected
206208 do {
207209 var driver = try Driver . forTesting ( args: [ " swiftc " , " -print-target-info " , " -tools-directory " , toolsDirectory. pathString] ,
208- env: [ PATH: tempDirectory. pathString, SWIFT_SCANNER_LIB: customSwiftScan. pathString] )
210+ env: [ PATH: tempDirectory. pathString, SWIFT_SCANNER_LIB: customSwiftScan. pathString] ,
211+ fileSystem: fs)
209212 let jobs = try driver. planBuild ( )
210213 #expect( jobs. count == 1 )
211214 expectEqual ( jobs. first!. tool. name, customSwiftFrontend. pathString)
@@ -219,8 +222,8 @@ import CRT
219222 let separator = " : "
220223#endif
221224 var driver = try Driver . forTesting ( args: [ " swiftc " , " -print-target-info " ] ,
222- cwd : tempDirectory ,
223- env : [ PATH : [ toolsDirectory . pathString , ProcessEnv . path! ] . joined ( separator : separator ) , SWIFT_SCANNER_LIB : customSwiftScan . pathString ] )
225+ env : [ PATH : [ toolsDirectory . pathString , ProcessEnv . path! ] . joined ( separator : separator ) , SWIFT_SCANNER_LIB : customSwiftScan . pathString ] ,
226+ fileSystem : fs )
224227 let jobs = try driver. planBuild ( )
225228 #expect( jobs. count == 1 )
226229 expectEqual ( jobs. first!. tool. name, anotherSwiftFrontend. pathString)
0 commit comments