You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Build/LLBuildCommands.swift
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -249,27 +249,27 @@ final class TestEntryPointCommand: CustomLLBuildCommand, TestBuildCommand {
249
249
@main
250
250
@available(*, deprecated, message: "Not actually deprecated. Marked as deprecated to allow inclusion of deprecated tests (which test deprecated functionality) without warnings")
251
251
struct Runner {
252
-
static func which() -> String {
253
-
// HACK: abstract this check properly!
254
-
let args = CommandLine.arguments
255
-
if args.contains("--testing-library=swift-testing") {
256
-
return "swift-testing"
257
-
} else if args.contains("--testing-library=xctest") {
258
-
return "XCTest"
252
+
private static func testingLibrary() -> String {
253
+
var iterator = CommandLine.arguments.makeIterator()
254
+
while let argument = iterator.next() {
255
+
if argument == "--testing-library", let libraryName = iterator.next() {
256
+
return libraryName.lowercased()
257
+
}
259
258
}
259
+
260
260
// Fallback if not specified: run XCTest (legacy behavior)
261
-
return "XCTest"
261
+
return "xctest"
262
262
}
263
263
264
264
static func main() async {
265
-
let which = Self.which()
265
+
let testingLibrary = Self.testingLibrary()
266
266
#if \#(swiftTestingImportCondition)
267
-
if which == "swift-testing" {
267
+
if testingLibrary == "swift-testing" {
268
268
await Testing.__swiftPMEntryPoint() as Never
269
269
}
270
270
#endif
271
271
#if \#(xctestImportCondition)
272
-
if which == "XCTest" {
272
+
if testingLibrary == "xctest" {
273
273
\#(testObservabilitySetup)
274
274
#if os(WASI)
275
275
/// On WASI, we can't block the main thread, so XCTestMain is defined as async.
0 commit comments