Skip to content

Commit 1f5cea2

Browse files
committed
SwiftDriverTests: repair the tests on Darwin
`swift-autolink-extract` is not available on macOS and thus the toolchain creation fails. Add a mock placeholder to allow us to run the tests on Darwin.
1 parent a2786ee commit 1f5cea2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4437,11 +4437,14 @@ final class SwiftDriverTests: XCTestCase {
44374437
$0.send("garbage")
44384438
}
44394439

4440+
var env = ProcessEnv.vars
4441+
env["SWIFT_DRIVER_SWIFT_AUTOLINK_EXTRACT_EXEC"] = "//bin/swift-autolink-extract"
4442+
44404443
for triple in ["wasm32-unknown-wasi", "wasm32-unknown-wasip1-threads"] {
44414444
var driver = try Driver(args: [
44424445
"swiftc", "-profile-generate", "-target", triple, "test.swift",
44434446
"-resource-dir", resourceDir.pathString
4444-
])
4447+
], env: env)
44454448
let plannedJobs = try driver.planBuild().removingAutolinkExtractJobs()
44464449

44474450
XCTAssertEqual(plannedJobs.count, 2)
@@ -4589,6 +4592,9 @@ final class SwiftDriverTests: XCTestCase {
45894592

45904593
// WASI toolchain
45914594
do {
4595+
var env = ProcessEnv.vars
4596+
env["SWIFT_DRIVER_SWIFT_AUTOLINK_EXTRACT_EXEC"] = "//bin/swift-autolink-extract"
4597+
45924598
try withTemporaryDirectory { resourceDir in
45934599
try localFileSystem.writeFileContents(resourceDir.appending(components: "wasi", "static-executable-args.lnk")) {
45944600
$0.send("garbage")

0 commit comments

Comments
 (0)