Skip to content

Commit 9654e61

Browse files
committed
Update a couple of tests to match latest toolchain expectations.
Explicit Module Build test input .swiftinterface files to explicitly bring in SwiftONoneSupport Triple tests to allow fallback to `swift` from `swift-frontend`
1 parent a62bc1a commit 9654e61

File tree

6 files changed

+11
-3
lines changed

6 files changed

+11
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// swift-interface-format-version: 1.0
22
// swift-module-flags: -module-name A
33
import Swift
4+
import SwiftOnoneSupport
45
@_exported import A
56
public func overlayFuncA() { }
67

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// swift-interface-format-version: 1.0
22
// swift-module-flags: -module-name E
33
import Swift
4+
import SwiftOnoneSupport
45
public func funcE() { }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// swift-interface-format-version: 1.0
22
// swift-module-flags: -module-name F
33
import Swift
4+
import SwiftOnoneSupport
45
@_exported import F
56
public func funcF() { }

TestInputs/ExplicitModuleBuilds/Swift/G.swiftinterface

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#if swift(>=5.0)
55
import Swift
6+
import SwiftOnoneSupport
67
@_exported import G
78
public func overlayFuncG() { }
89

Tests/SwiftDriverTests/ExplicitModuleBuildTests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
264264
"-I", swiftModuleInterfacesPath,
265265
"-experimental-explicit-module-build",
266266
"-working-directory", path.pathString,
267-
main.pathString])
267+
main.pathString],
268+
env: ProcessEnv.vars)
268269
let jobs = try driver.planBuild()
269270
try driver.run(jobs: jobs)
270271
XCTAssertFalse(driver.diagnosticEngine.hasErrors)

Tests/SwiftDriverTests/JobExecutorTests.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ final class JobExecutorTests: XCTestCase {
234234
// DarwinToolchain
235235
env.removeValue(forKey: envVarName)
236236
let normalSwiftPath = try DarwinToolchain(env: env, executor: executor).getToolPath(.swiftCompiler)
237-
XCTAssertEqual(normalSwiftPath.basenameWithoutExt, "swift-frontend")
237+
// Match Toolchain temporary shim of a fallback to looking for "swift" before failing.
238+
XCTAssertTrue(normalSwiftPath.basenameWithoutExt == "swift-frontend" ||
239+
normalSwiftPath.basenameWithoutExt == "swift")
238240

239241
env[envVarName] = dummyPath
240242
let overriddenSwiftPath = try DarwinToolchain(env: env, executor: executor).getToolPath(.swiftCompiler)
@@ -243,7 +245,8 @@ final class JobExecutorTests: XCTestCase {
243245
// GenericUnixToolchain
244246
env.removeValue(forKey: envVarName)
245247
let unixSwiftPath = try GenericUnixToolchain(env: env, executor: executor).getToolPath(.swiftCompiler)
246-
XCTAssertEqual(unixSwiftPath.basenameWithoutExt, "swift-frontend")
248+
XCTAssertTrue(unixSwiftPath.basenameWithoutExt == "swift-frontend" ||
249+
unixSwiftPath.basenameWithoutExt == "swift")
247250

248251
env[envVarName] = dummyPath
249252
let unixOverriddenSwiftPath = try GenericUnixToolchain(env: env, executor: executor).getToolPath(.swiftCompiler)

0 commit comments

Comments
 (0)