Skip to content

Commit 827f87d

Browse files
committed
Reset CWD after SwiftDriverTests.testToolSearching
1 parent 221f742 commit 827f87d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6623,13 +6623,16 @@ final class SwiftDriverTests: XCTestCase {
66236623
let jobs = try driver.planBuild()
66246624
XCTAssertEqual(jobs.count, 1)
66256625
let defaultSwiftFrontend = jobs.first!.tool.absolutePath!
6626+
let originalWorkingDirectory = localFileSystem.currentWorkingDirectory!
66266627

66276628
try withTemporaryDirectory { toolsDirectory in
66286629
let customSwiftFrontend = toolsDirectory.appending(component: executableName("swift-frontend"))
66296630
try localFileSystem.createSymbolicLink(customSwiftFrontend, pointingAt: defaultSwiftFrontend, relative: false)
66306631

66316632
try withTemporaryDirectory { tempDirectory in
66326633
try localFileSystem.changeCurrentWorkingDirectory(to: tempDirectory)
6634+
defer { try! localFileSystem.changeCurrentWorkingDirectory(to: originalWorkingDirectory) }
6635+
66336636
let anotherSwiftFrontend = localFileSystem.currentWorkingDirectory!.appending(component: executableName("swift-frontend"))
66346637
try localFileSystem.createSymbolicLink(anotherSwiftFrontend, pointingAt: defaultSwiftFrontend, relative: false)
66356638

0 commit comments

Comments
 (0)