@@ -61,9 +61,10 @@ final class IncrementalCompilationTests: XCTestCase {
61
61
var commonArgs : [ String ] {
62
62
[
63
63
" swiftc " ,
64
+ " -Xcc " , " -Xclang " , " -Xcc " , " -fbuiltin-headers-in-system-modules " ,
64
65
" -module-name " , module,
65
- " -o " , derivedDataPath. appending ( component: module + " .o " ) . nativePathString ( escaped: true ) ,
66
- " -output-file-map " , OFM . nativePathString ( escaped: true ) ,
66
+ " -o " , derivedDataPath. appending ( component: module + " .o " ) . nativePathString ( escaped: false ) ,
67
+ " -output-file-map " , OFM . nativePathString ( escaped: false ) ,
67
68
" -driver-show-incremental " ,
68
69
" -driver-show-job-lifecycle " ,
69
70
" -enable-batch-mode " ,
@@ -72,7 +73,7 @@ final class IncrementalCompilationTests: XCTestCase {
72
73
" -incremental " ,
73
74
" -no-color-diagnostics " ,
74
75
]
75
- + inputPathsAndContents. map { $0. 0 . nativePathString ( escaped: true ) } . sorted ( )
76
+ + inputPathsAndContents. map ( { $0. 0 . nativePathString ( escaped: false ) } ) . sorted ( )
76
77
}
77
78
78
79
var explicitModuleCacheDir : AbsolutePath {
@@ -98,12 +99,12 @@ final class IncrementalCompilationTests: XCTestCase {
98
99
99
100
var explicitBuildArgs : [ String ] {
100
101
[ " -explicit-module-build " ,
101
- " -module-cache-path " , explicitModuleCacheDir. nativePathString ( escaped: true ) ,
102
+ " -module-cache-path " , explicitModuleCacheDir. nativePathString ( escaped: false ) ,
102
103
// Disable implicit imports to keep tests simpler
103
104
" -Xfrontend " , " -disable-implicit-concurrency-module-import " ,
104
105
" -Xfrontend " , " -disable-implicit-string-processing-module-import " ,
105
- " -I " , explicitCDependenciesPath. nativePathString ( escaped: true ) ,
106
- " -I " , explicitSwiftDependenciesPath. nativePathString ( escaped: true ) ] + extraExplicitBuildArgs
106
+ " -I " , explicitCDependenciesPath. nativePathString ( escaped: false ) ,
107
+ " -I " , explicitSwiftDependenciesPath. nativePathString ( escaped: false ) ] + extraExplicitBuildArgs
107
108
}
108
109
var extraExplicitBuildArgs : [ String ] = [ ]
109
110
@@ -193,23 +194,21 @@ extension IncrementalCompilationTests {
193
194
func testAutolinkOutputPath( ) throws {
194
195
var env = ProcessEnv . vars
195
196
env [ " SWIFT_DRIVER_TESTS_ENABLE_EXEC_PATH_FALLBACK " ] = " 1 "
196
- env [ " SWIFT_DRIVER_SWIFT_AUTOLINK_EXTRACT_EXEC " ] = " /garbage/swift-autolink-extract "
197
- env [ " SWIFT_DRIVER_DSYMUTIL_EXEC " ] = " /garbage/dsymutil "
198
-
199
- var driver = try Driver (
200
- args: commonArgs
201
- + [ " -emit-library " , " -target " , " x86_64-unknown-linux " ] ,
202
- env: env)
203
- let plannedJobs = try driver. planBuild ( )
204
- let autolinkExtractJob = try XCTUnwrap (
205
- plannedJobs
206
- . filter { $0. kind == . autolinkExtract }
207
- . first)
208
- let autoOuts = autolinkExtractJob. outputs. filter { $0. type == . autolink}
209
- XCTAssertEqual ( autoOuts. count, 1 )
210
- let autoOut = autoOuts [ 0 ]
197
+ env [ " SWIFT_DRIVER_SWIFT_AUTOLINK_EXTRACT_EXEC " ] = " //usr/bin/swift-autolink-extract "
198
+ env [ " SWIFT_DRIVER_DSYMUTIL_EXEC " ] = " //usr/bin/dsymutil "
199
+
200
+ var driver = try Driver ( args: commonArgs + [
201
+ " -emit-library " , " -target " , " x86_64-unknown-linux "
202
+ ] , env: env)
203
+
204
+ let jobs = try driver. planBuild ( )
205
+ let job = try XCTUnwrap ( jobs. filter { $0. kind == . autolinkExtract } . first)
206
+
207
+ let outputs = job. outputs. filter { $0. type == . autolink }
208
+ XCTAssertEqual ( outputs. count, 1 )
209
+
211
210
let expected = try AbsolutePath ( validating: " \( module) .autolink " , relativeTo: derivedDataPath)
212
- XCTAssertEqual ( autoOut . file. absolutePath, expected)
211
+ XCTAssertEqual ( outputs . first! . file. absolutePath, expected)
213
212
}
214
213
}
215
214
@@ -518,7 +517,7 @@ extension IncrementalCompilationTests {
518
517
// and repeat the initial build to settle into the "initial" state for the test
519
518
try buildInitialState ( checkDiagnostics: false , explicitModuleBuild: true )
520
519
let modCacheEntries = try localFileSystem. getDirectoryContents ( explicitModuleCacheDir)
521
- let nameOfGModule = try XCTUnwrap ( modCacheEntries. first { $0. hasPrefix ( " G " ) && $0. hasSuffix ( " .swiftmodule " ) } )
520
+ let nameOfGModule = try XCTUnwrap ( modCacheEntries. first { $0. hasPrefix ( " G " ) && $0. hasSuffix ( " .swiftmodule " ) } )
522
521
let pathToGModule = explicitModuleCacheDir. appending ( component: nameOfGModule)
523
522
// Rename the binary module to G.swiftmodule so that the next build's scan finds it.
524
523
let newPathToGModule = explicitSwiftDependenciesPath. appending ( component: " G.swiftmodule " )
@@ -568,8 +567,8 @@ extension IncrementalCompilationTests {
568
567
extension IncrementalCompilationTests {
569
568
// A dependency has changed one of its inputs
570
569
func testIncrementalImplicitBuildChangedDependency( ) throws {
571
- let extraAruments = [ " -I " , explicitCDependenciesPath. nativePathString ( escaped: true ) ,
572
- " -I " , explicitSwiftDependenciesPath. nativePathString ( escaped: true ) ]
570
+ let extraAruments = [ " -I " , explicitCDependenciesPath. nativePathString ( escaped: false ) ,
571
+ " -I " , explicitSwiftDependenciesPath. nativePathString ( escaped: false ) ]
573
572
replace ( contentsOf: " other " , with: " import E;let bar = foo " )
574
573
try buildInitialState ( checkDiagnostics: false , extraArguments: extraAruments)
575
574
touch ( try AbsolutePath ( validating: explicitSwiftDependenciesPath. appending ( component: " E.swiftinterface " ) . pathString) )
0 commit comments