Skip to content

Commit 83e3abd

Browse files
authored
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 2df5199 commit 83e3abd

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")],
@@ -171,7 +185,7 @@ let package = Package(
171185
"LifetimeDependenceMutableAccessors",
172186
.when(platforms: [.macOS, .iOS, .watchOS, .tvOS, .linux])
173187
),
174-
] + availabilityMacros + featureSettings
188+
] + availabilityMacros + featureSettings + testOnlySwiftSettings
175189
),
176190

177191
// FoundationInternationalization
@@ -204,7 +218,7 @@ let package = Package(
204218
"TestSupport",
205219
"FoundationInternationalization",
206220
],
207-
swiftSettings: availabilityMacros + featureSettings
221+
swiftSettings: availabilityMacros + featureSettings + testOnlySwiftSettings
208222
),
209223

210224
// FoundationMacros
@@ -236,7 +250,7 @@ package.targets.append(contentsOf: [
236250
"FoundationMacros",
237251
"TestSupport"
238252
],
239-
swiftSettings: availabilityMacros + featureSettings
253+
swiftSettings: availabilityMacros + featureSettings + testOnlySwiftSettings
240254
)
241255
])
242256
#endif

0 commit comments

Comments
 (0)