Skip to content

Commit 4b6813c

Browse files
jmschonfeldchloe-yeo
authored andcommitted
Reenable AttributedString index tracking swift testing tests (#1338)
* Revert "Revert "Add tests for AttributedString Index Tracking preconditions (#1326)" (#1337)" This reverts commit 2df5199. * Disable exit tests on Ubuntu 20.04 for now
1 parent fcae1ae commit 4b6813c

File tree

2 files changed

+172
-74
lines changed

2 files changed

+172
-74
lines changed

Package.swift

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ let wasiLibcCSettings: [CSetting] = [
7575
.define("_WASI_EMULATED_MMAN", .when(platforms: [.wasi])),
7676
]
7777

78+
var testOnlySwiftSettings: [SwiftSetting] = [
79+
// The latest Windows toolchain does not yet have exit tests in swift-testing
80+
.define("FOUNDATION_EXIT_TESTS", .when(platforms: [.macOS, .linux, .openbsd]))
81+
]
82+
83+
#if os(Linux)
84+
import FoundationEssentials
85+
86+
if ProcessInfo.processInfo.operatingSystemVersionString.hasPrefix("Ubuntu 20.") {
87+
// Exit tests currently hang indefinitely on Ubuntu 20.
88+
testOnlySwiftSettings.removeFirst()
89+
}
90+
#endif
91+
7892
let package = Package(
7993
name: "swift-foundation",
8094
platforms: [.macOS("15"), .iOS("18"), .tvOS("18"), .watchOS("11")],
@@ -172,7 +186,7 @@ let package = Package(
172186
"LifetimeDependenceMutableAccessors",
173187
.when(platforms: [.macOS, .iOS, .watchOS, .tvOS, .linux])
174188
),
175-
] + availabilityMacros + featureSettings
189+
] + availabilityMacros + featureSettings + testOnlySwiftSettings
176190
),
177191

178192
// FoundationInternationalization
@@ -206,7 +220,7 @@ let package = Package(
206220
"TestSupport",
207221
"FoundationInternationalization",
208222
],
209-
swiftSettings: availabilityMacros + featureSettings
223+
swiftSettings: availabilityMacros + featureSettings + testOnlySwiftSettings
210224
),
211225

212226
// FoundationMacros
@@ -238,7 +252,7 @@ package.targets.append(contentsOf: [
238252
"FoundationMacros",
239253
"TestSupport"
240254
],
241-
swiftSettings: availabilityMacros + featureSettings
255+
swiftSettings: availabilityMacros + featureSettings + testOnlySwiftSettings
242256
)
243257
])
244258
#endif

0 commit comments

Comments
 (0)