Skip to content

Commit 1c06be1

Browse files
committed
Update a few tests to correctly build for the host platform on linux
1 parent 1c57379 commit 1c06be1

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Tests/SWBBuildSystemTests/CustomTaskBuildOperationTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ fileprivate struct CustomTaskBuildOperationTests: CoreBasedTests {
4848
TestBuildConfiguration(
4949
"Debug",
5050
buildSettings: [
51+
"ARCHS": "$(ARCHS_STANDARD)",
5152
"GENERATE_INFOPLIST_FILE": "YES",
5253
"PRODUCT_NAME": "$(TARGET_NAME)",
5354
"SWIFT_VERSION": try await swiftVersion,
54-
"SDKROOT": "auto",
55+
"SDKROOT": "$(HOST_PLATFORM)",
56+
"SUPPORTED_PLATFORMS": "$(HOST_PLATFORM)",
5557
"CODE_SIGNING_ALLOWED": "NO",
5658
"MACOSX_DEPLOYMENT_TARGET": "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"
5759
]),
@@ -105,7 +107,7 @@ fileprivate struct CustomTaskBuildOperationTests: CoreBasedTests {
105107
"""
106108
}
107109

108-
try await tester.checkBuild(parameters: parameters) { results in
110+
try await tester.checkBuild(parameters: parameters, runDestination: .host) { results in
109111
results.checkWarning(.contains("this is a warning"))
110112
results.checkNoDiagnostics()
111113
}

Tests/SWBTaskConstructionTests/SwiftTaskConstructionTests.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3937,7 +3937,9 @@ fileprivate struct SwiftTaskConstructionTests: CoreBasedTests {
39373937
TestBuildConfiguration("Debug", buildSettings: [
39383938
"SWIFT_WARNINGS_AS_WARNINGS_GROUPS": "Unsafe DeprecatedDeclaration",
39393939
"SWIFT_EXEC": swiftCompilerPath.str,
3940-
"CODE_SIGN_IDENTITY": ""
3940+
"CODE_SIGN_IDENTITY": "",
3941+
"SDKROOT": "$(HOST_PLATFORM)",
3942+
"SUPPORTED_PLATFORMS": "$(HOST_PLATFORM)",
39413943
]),
39423944
],
39433945
buildPhases: [
@@ -3949,7 +3951,7 @@ fileprivate struct SwiftTaskConstructionTests: CoreBasedTests {
39493951

39503952
let tester = try await TaskConstructionTester(getCore(), testProject)
39513953

3952-
try await tester.checkBuild(BuildParameters(configuration: "Debug", overrides: ["SWIFT_VERSION": swiftVersion])) { results in
3954+
try await tester.checkBuild(BuildParameters(configuration: "Debug", overrides: ["SWIFT_VERSION": swiftVersion]), runDestination: .host) { results in
39533955
results.checkTarget("TargetName") { target in
39543956
results.checkTask(.matchTarget(target), .matchRuleType("SwiftDriver Compilation")) { task in
39553957
task.checkCommandLineContains([
@@ -3981,7 +3983,9 @@ fileprivate struct SwiftTaskConstructionTests: CoreBasedTests {
39813983
TestBuildConfiguration("Debug", buildSettings: [
39823984
"SWIFT_WARNINGS_AS_ERRORS_GROUPS": "UnknownWarningGroup PreconcurrencyImport",
39833985
"SWIFT_EXEC": swiftCompilerPath.str,
3984-
"CODE_SIGN_IDENTITY": ""
3986+
"CODE_SIGN_IDENTITY": "",
3987+
"SDKROOT": "$(HOST_PLATFORM)",
3988+
"SUPPORTED_PLATFORMS": "$(HOST_PLATFORM)",
39853989
]),
39863990
],
39873991
buildPhases: [
@@ -3993,7 +3997,7 @@ fileprivate struct SwiftTaskConstructionTests: CoreBasedTests {
39933997

39943998
let tester = try await TaskConstructionTester(getCore(), testProject)
39953999

3996-
try await tester.checkBuild(BuildParameters(configuration: "Debug", overrides: ["SWIFT_VERSION": swiftVersion])) { results in
4000+
try await tester.checkBuild(BuildParameters(configuration: "Debug", overrides: ["SWIFT_VERSION": swiftVersion]), runDestination: .host) { results in
39974001
results.checkTarget("TargetName") { target in
39984002
results.checkTask(.matchTarget(target), .matchRuleType("SwiftDriver Compilation")) { task in
39994003
task.checkCommandLineContains([

0 commit comments

Comments
 (0)