Skip to content

Commit 7ced783

Browse files
committed
Tests: correct invalid tests
These tests specified the Darwin triple unconditionally, resulting in the test always being run in Darwin mode. However, the ABI output is not emitted on all platforms, which resulted in an out-of-bounds access in the output. Remove the explicit target triple, repairing the tests on Windows.
1 parent 1a7cde9 commit 7ced783

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,9 +2352,9 @@ final class SwiftDriverTests: XCTestCase {
23522352
var envVars = ProcessEnv.vars
23532353
envVars["SWIFT_DRIVER_LD_EXEC"] = ld.nativePathString(escaped: false)
23542354

2355-
var driver1 = try Driver(args: ["swiftc", "-whole-module-optimization", "foo.swift", "bar.swift", "-emit-library", "-emit-module", "-module-name", "Test", "-target", "x86_64-apple-macosx10.15", "-emit-module-interface", "-emit-objc-header-path", "Test-Swift.h", "-emit-private-module-interface-path", "Test.private.swiftinterface", "-emit-tbd"],
2355+
var driver1 = try Driver(args: ["swiftc", "-whole-module-optimization", "foo.swift", "bar.swift", "-emit-library", "-emit-module", "-module-name", "Test", "-emit-module-interface", "-emit-objc-header-path", "Test-Swift.h", "-emit-private-module-interface-path", "Test.private.swiftinterface", "-emit-tbd"],
23562356
env: envVars)
2357-
let plannedJobs = try driver1.planBuild()
2357+
let plannedJobs = try driver1.planBuild().removingAutolinkExtractJobs()
23582358
XCTAssertEqual(plannedJobs.count, 3)
23592359
XCTAssertEqual(Set(plannedJobs.map { $0.kind }), Set([.compile, .emitModule, .link]))
23602360

@@ -2767,9 +2767,9 @@ final class SwiftDriverTests: XCTestCase {
27672767
let root = try localFileSystem.currentWorkingDirectory.map { AbsolutePath("/foo/bar", relativeTo: $0) }
27682768
?? AbsolutePath(validating: "/foo/bar")
27692769

2770-
var driver = try Driver(args: ["swiftc", "foo.swift", "bar.swift", "-module-name", "Test", "-emit-module-path", rebase("Test.swiftmodule", at: root), "-emit-symbol-graph", "-emit-symbol-graph-dir", "/foo/bar/", "-experimental-emit-module-separately", "-emit-library", "-target", "x86_64-apple-macosx10.15"],
2770+
var driver = try Driver(args: ["swiftc", "foo.swift", "bar.swift", "-module-name", "Test", "-emit-module-path", rebase("Test.swiftmodule", at: root), "-emit-symbol-graph", "-emit-symbol-graph-dir", "/foo/bar/", "-experimental-emit-module-separately", "-emit-library"],
27712771
env: envVars)
2772-
let plannedJobs = try driver.planBuild()
2772+
let plannedJobs = try driver.planBuild().removingAutolinkExtractJobs()
27732773
XCTAssertEqual(plannedJobs.count, 4)
27742774
XCTAssertEqual(Set(plannedJobs.map { $0.kind }), Set([.compile, .emitModule, .link]))
27752775
XCTAssertTrue(plannedJobs[0].tool.name.contains("swift"))

0 commit comments

Comments
 (0)