Skip to content

Commit ab4c8ec

Browse files
committed
Tests: repair test for Windows
The index was incorrectly `2` for non-Darwin targets. Windows does not have the autolink extract phase which results in a off-by-one index. Use the test helper to exclude the auto-link-extract job to support Linux and Windows similarly.
1 parent 22b351b commit ab4c8ec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5026,10 +5026,12 @@ final class SwiftDriverTests: XCTestCase {
50265026
_ = try driverWithEmptySDK.planBuild()
50275027

50285028
var driver = try Driver(args: ["swiftc", "foo.swift", "-sdk", "/"])
5029-
let plannedJobs = try driver.planBuild()
5029+
let plannedJobs = try driver.planBuild().removingAutolinkExtractJobs()
5030+
50305031
XCTAssertTrue(plannedJobs[0].commandLine.contains(subsequence: ["-sdk", .path(.absolute(try .init(validating: "/")))]))
5032+
50315033
if !driver.targetTriple.isDarwin {
5032-
XCTAssertFalse(plannedJobs[2].commandLine.contains(subsequence: ["-L", .path(.absolute(try .init(validating: "/usr/lib/swift")))]))
5034+
XCTAssertFalse(plannedJobs[1].commandLine.contains(subsequence: ["-L", .path(.absolute(try .init(validating: "/usr/lib/swift")))]))
50335035
}
50345036
}
50355037

0 commit comments

Comments
 (0)