Skip to content

Commit c0d2cf9

Browse files
authored
Merge pull request #955 from compnerd/sdks
Tests: explicitly pass a SDK for environment inference tests
2 parents 21f12f3 + f204f04 commit c0d2cf9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3053,13 +3053,15 @@ final class SwiftDriverTests: XCTestCase {
30533053
}
30543054

30553055
func testEnvironmentInferenceWarning() throws {
3056-
try assertDriverDiagnostics(args: ["swiftc", "-target", "x86_64-apple-ios13.0", "foo.swift"]) {
3056+
let sdkRoot = testInputsPath.appending(component: "SDKChecks").appending(component: "iPhoneOS.sdk")
3057+
3058+
try assertDriverDiagnostics(args: ["swiftc", "-target", "x86_64-apple-ios13.0", "foo.swift", "-sdk", sdkRoot.pathString]) {
30573059
$1.expect(.warning("inferring simulator environment for target 'x86_64-apple-ios13.0'; use '-target x86_64-apple-ios13.0-simulator'"))
30583060
}
3059-
try assertDriverDiagnostics(args: ["swiftc", "-target", "x86_64-apple-watchos6.0", "foo.swift"]) {
3061+
try assertDriverDiagnostics(args: ["swiftc", "-target", "x86_64-apple-watchos6.0", "foo.swift", "-sdk", sdkRoot.pathString]) {
30603062
$1.expect(.warning("inferring simulator environment for target 'x86_64-apple-watchos6.0'; use '-target x86_64-apple-watchos6.0-simulator'"))
30613063
}
3062-
try assertNoDriverDiagnostics(args: "swiftc", "-target", "x86_64-apple-ios13.0-simulator", "foo.swift")
3064+
try assertNoDriverDiagnostics(args: "swiftc", "-target", "x86_64-apple-ios13.0-simulator", "foo.swift", "-sdk", sdkRoot.pathString)
30633065
}
30643066

30653067
func testDarwinToolchainArgumentValidation() throws {

0 commit comments

Comments
 (0)