Skip to content

Commit ea437d8

Browse files
authored
Merge pull request #153 from artemcm/FixDriverTrunk
Fix tests to match behaviour expected with newest toolchain
2 parents c79be1c + 161d7dd commit ea437d8

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ ln -s /path/to/built/swift-driver $SOME_PATH/swift
2424
ln -s /path/to/built/swift-driver $SOME_PATH/swiftc
2525
```
2626

27-
Swift packages can be built with the new Swift driver by overriding `SWIFT_EXEC` to refer to the `swiftc` symbolic link created above and `SWIFT_DRIVER_SWIFT_EXEC` to refer to the original `swiftc`, e.g.,
27+
Swift packages can be built with the new Swift driver by overriding `SWIFT_EXEC` to refer to the `swiftc` symbolic link created above and `SWIFT_DRIVER_SWIFT_FRONTEND_EXEC` to refer to the original `swift-frontend`, e.g.,
2828

2929
```
30-
SWIFT_EXEC=$SOME_PATH/swiftc SWIFT_DRIVER_SWIFT_EXEC=$TOOLCHAIN_PATH/bin/swiftc swift build
30+
SWIFT_EXEC=$SOME_PATH/swiftc SWIFT_DRIVER_SWIFT_FRONTEND_EXEC=$TOOLCHAIN_PATH/bin/swift-frontend swift build
3131
```
3232

3333
Similarly, one can use the new Swift driver within Xcode by adding a custom build setting (usually at the project level) named `SWIFT_EXEC` that refers to `$SOME_PATH/swiftc` and adding `-driver-use-frontend-path $TOOLCHAIN_DIR/usr/bin/swiftc` to `Other Swift Flags`.

Tests/SwiftDriverTests/JobExecutorTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ final class JobExecutorTests: XCTestCase {
192192

193193
func testSwiftDriverExecOverride() throws {
194194
var env = ProcessEnv.vars
195-
let envVarName = "SWIFT_DRIVER_SWIFT_EXEC"
195+
let envVarName = "SWIFT_DRIVER_SWIFT_FRONTEND_EXEC"
196196
let dummyPath = "/some/garbage/path/fnord"
197197
let executor = try SwiftDriverExecutor(diagnosticsEngine: DiagnosticsEngine(),
198198
processSet: ProcessSet(),
@@ -202,7 +202,7 @@ final class JobExecutorTests: XCTestCase {
202202
// DarwinToolchain
203203
env.removeValue(forKey: envVarName)
204204
let normalSwiftPath = try DarwinToolchain(env: env, executor: executor).getToolPath(.swiftCompiler)
205-
XCTAssertEqual(normalSwiftPath.basenameWithoutExt, "swift")
205+
XCTAssertEqual(normalSwiftPath.basenameWithoutExt, "swift-frontend")
206206

207207
env[envVarName] = dummyPath
208208
let overriddenSwiftPath = try DarwinToolchain(env: env, executor: executor).getToolPath(.swiftCompiler)
@@ -211,7 +211,7 @@ final class JobExecutorTests: XCTestCase {
211211
// GenericUnixToolchain
212212
env.removeValue(forKey: envVarName)
213213
let unixSwiftPath = try GenericUnixToolchain(env: env, executor: executor).getToolPath(.swiftCompiler)
214-
XCTAssertEqual(unixSwiftPath.basenameWithoutExt, "swift")
214+
XCTAssertEqual(unixSwiftPath.basenameWithoutExt, "swift-frontend")
215215

216216
env[envVarName] = dummyPath
217217
let unixOverriddenSwiftPath = try GenericUnixToolchain(env: env, executor: executor).getToolPath(.swiftCompiler)

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,19 +1584,19 @@ final class SwiftDriverTests: XCTestCase {
15841584
XCTAssertEqual(output,
15851585
"""
15861586
digraph Jobs {
1587-
"compile (swiftc)" [style=bold];
1587+
"compile (swift-frontend)" [style=bold];
15881588
"test.swift" [fontsize=12];
1589-
"test.swift" -> "compile (swiftc)" [color=blue];
1589+
"test.swift" -> "compile (swift-frontend)" [color=blue];
15901590
"test.o" [fontsize=12];
1591-
"compile (swiftc)" -> "test.o" [color=green];
1591+
"compile (swift-frontend)" -> "test.o" [color=green];
15921592
"test.swiftmodule" [fontsize=12];
1593-
"compile (swiftc)" -> "test.swiftmodule" [color=green];
1593+
"compile (swift-frontend)" -> "test.swiftmodule" [color=green];
15941594
"test.swiftdoc" [fontsize=12];
1595-
"compile (swiftc)" -> "test.swiftdoc" [color=green];
1596-
"mergeModule (swiftc)" [style=bold];
1597-
"test.swiftmodule" -> "mergeModule (swiftc)" [color=blue];
1598-
"mergeModule (swiftc)" -> "test.swiftmodule" [color=green];
1599-
"mergeModule (swiftc)" -> "test.swiftdoc" [color=green];
1595+
"compile (swift-frontend)" -> "test.swiftdoc" [color=green];
1596+
"mergeModule (swift-frontend)" [style=bold];
1597+
"test.swiftmodule" -> "mergeModule (swift-frontend)" [color=blue];
1598+
"mergeModule (swift-frontend)" -> "test.swiftmodule" [color=green];
1599+
"mergeModule (swift-frontend)" -> "test.swiftdoc" [color=green];
16001600
"link (\(dynamicLinker))" [style=bold];
16011601
"test.o" -> "link (\(dynamicLinker))" [color=blue];
16021602
"test" [fontsize=12];

0 commit comments

Comments
 (0)