Skip to content

Commit ad20675

Browse files
committed
Fix testToolsDirectory test in environments with SWIFT_DRIVER_CLANG_EXEC set
1 parent 60ed766 commit ad20675

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3773,9 +3773,16 @@ final class SwiftDriverTests: XCTestCase {
37733773
]
37743774
try localFileSystem.writeFileContents(ld) { $0 <<< contents }
37753775
try localFileSystem.chmod(.executable, path: AbsolutePath(ld.pathString))
3776+
3777+
// Drop SWIFT_DRIVER_CLANG_EXEC from the environment so it doesn't
3778+
// interfere with tool lookup.
3779+
var env = ProcessEnv.vars
3780+
env.removeValue(forKey: "SWIFT_DRIVER_CLANG_EXEC")
3781+
37763782
var driver = try Driver(args: ["swiftc",
37773783
"-tools-directory", tmpDir.pathString,
3778-
"foo.swift"])
3784+
"foo.swift"],
3785+
env: env)
37793786
let frontendJobs = try driver.planBuild().removingAutolinkExtractJobs()
37803787
XCTAssertEqual(frontendJobs.count, 2)
37813788
XCTAssertEqual(frontendJobs[1].kind, .link)

0 commit comments

Comments
 (0)