Skip to content

Commit b4b0764

Browse files
authored
Merge pull request #189 from artemcm/DriverGardener
Update tests to match latest toolchain expectations.
2 parents e2eca46 + 9654e61 commit b4b0764

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
@@ -274,7 +274,8 @@ final class ExplicitModuleBuildTests: XCTestCase {
274274
"-I", swiftModuleInterfacesPath,
275275
"-experimental-explicit-module-build",
276276
"-working-directory", path.pathString,
277-
main.pathString])
277+
main.pathString],
278+
env: ProcessEnv.vars)
278279
let jobs = try driver.planBuild()
279280
try driver.run(jobs: jobs)
280281
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)