Skip to content

Commit afbddf5

Browse files
committed
Tests: add an explicit triple for Darwin SDK tests
This is required as the Windows toolchain uses `-sdk` for locating the SDK which is required for loading the standard library. Without this, we would target the default target (Windows), but use the stub SDK, which does not contain the standard library and thus fail to compile. This allows the SwiftDriverTests.SwiftDriverTests/testDarwinSDKTooOld test to pass on Windows.
1 parent c923c0a commit afbddf5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3399,7 +3399,7 @@ final class SwiftDriverTests: XCTestCase {
33993399
let sdkPath = getSDKPath(sdkDirName: sdkDirName)
34003400
// Get around the check for SDK's existence
34013401
try localFileSystem.createDirectory(sdkPath)
3402-
let args = [ "swiftc", "foo.swift", "-sdk", sdkPath.pathString ]
3402+
let args = [ "swiftc", "foo.swift", "-target", "x86_64-apple-macosx10.9", "-sdk", sdkPath.pathString ]
34033403
try assertDriverDiagnostics(args: args) { driver, verifier in
34043404
verifier.expect(.error("Swift does not support the SDK \(sdkPath.pathString)"))
34053405
}
@@ -3409,7 +3409,7 @@ final class SwiftDriverTests: XCTestCase {
34093409
func checkSDKOkay(sdkDirName: String) throws {
34103410
let sdkPath = getSDKPath(sdkDirName: sdkDirName)
34113411
try localFileSystem.createDirectory(sdkPath)
3412-
let args = [ "swiftc", "foo.swift", "-sdk", sdkPath.pathString ]
3412+
let args = [ "swiftc", "foo.swift", "-target", "x86_64-apple-macosx10.9", "-sdk", sdkPath.pathString ]
34133413
try assertNoDiagnostics { de in let _ = try Driver(args: args, diagnosticsEngine: de) }
34143414
}
34153415

0 commit comments

Comments
 (0)