@@ -314,10 +314,9 @@ fileprivate extension CompatibilityTest {
314
314
315
315
// Build the package.
316
316
let process = Process ( )
317
- process. executableURL = URL ( fileURLWithPath : " /usr/bin/env " )
317
+ process. executableURL = try resolveExecutable ( " swift " )
318
318
process. arguments = [
319
- " swift " , " build " , " --package-path " , packageDir. path, " -Xswiftc " , " -Xllvm " , " -Xswiftc " ,
320
- " -vectorize-slp=false " ,
319
+ " build " , " --package-path " , packageDir. path, " -Xswiftc " , " -Xllvm " , " -Xswiftc " , " -vectorize-slp=false " ,
321
320
]
322
321
if let numBuildJobs = compatibilityTestNumBuildJobs {
323
322
process. arguments!. append ( contentsOf: [ " -j " , String ( numBuildJobs) ] )
@@ -358,14 +357,12 @@ fileprivate extension CompatibilityTest {
358
357
func log( _ message: String ) { print ( " \( name) \( message) " ) }
359
358
360
359
var testCaseName : String {
361
- /// The `name` property is `<test-suite-name>. <test-case-name>` on Linux ,
362
- /// and `-[ <test-suite-name> <test-case-name>]` on macOS .
360
+ /// The `name` property is `-[ <test-suite-name> <test-case-name>] ` on Apple platforms (e.g. with an Objective-C runtime) ,
361
+ /// and `<test-suite-name>. <test-case-name>` elsewhere .
363
362
#if canImport(Darwin)
364
363
return String ( name. split ( separator: " " , maxSplits: 2 ) . last!. dropLast ( ) )
365
- #elseif os(Linux)
366
- return String ( name. split ( separator: " . " , maxSplits: 2 ) . last!)
367
364
#else
368
- #error("Platform not supported" )
365
+ return String ( name . split ( separator : " . " , maxSplits : 2 ) . last! )
369
366
#endif
370
367
}
371
368
}
@@ -417,7 +414,7 @@ fileprivate extension URLSession {
417
414
func data( from url: URL ) async throws -> ( Data , URLResponse ) {
418
415
#if canImport(Darwin)
419
416
return try await data ( from: url, delegate: nil )
420
- #elseif os(Linux)
417
+ #else
421
418
return try await withCheckedThrowingContinuation { continuation in
422
419
dataTask ( with: URLRequest ( url: url) ) { data, response, error in
423
420
if let error {
@@ -432,8 +429,6 @@ fileprivate extension URLSession {
432
429
}
433
430
. resume ( )
434
431
}
435
- #else
436
- #error("Platform not supported")
437
432
#endif
438
433
}
439
434
}
0 commit comments