@@ -314,10 +314,9 @@ fileprivate extension CompatibilityTest {
314314
315315 // Build the package.
316316 let process = Process ( )
317- process. executableURL = URL ( fileURLWithPath : " /usr/bin/env " )
317+ process. executableURL = try resolveExecutable ( " swift " )
318318 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 " ,
321320 ]
322321 if let numBuildJobs = compatibilityTestNumBuildJobs {
323322 process. arguments!. append ( contentsOf: [ " -j " , String ( numBuildJobs) ] )
@@ -358,14 +357,12 @@ fileprivate extension CompatibilityTest {
358357 func log( _ message: String ) { print ( " \( name) \( message) " ) }
359358
360359 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 .
363362 #if canImport(Darwin)
364363 return String ( name. split ( separator: " " , maxSplits: 2 ) . last!. dropLast ( ) )
365- #elseif os(Linux)
366- return String ( name. split ( separator: " . " , maxSplits: 2 ) . last!)
367364 #else
368- #error("Platform not supported" )
365+ return String ( name . split ( separator : " . " , maxSplits : 2 ) . last! )
369366 #endif
370367 }
371368}
@@ -417,7 +414,7 @@ fileprivate extension URLSession {
417414 func data( from url: URL ) async throws -> ( Data , URLResponse ) {
418415 #if canImport(Darwin)
419416 return try await data ( from: url, delegate: nil )
420- #elseif os(Linux)
417+ #else
421418 return try await withCheckedThrowingContinuation { continuation in
422419 dataTask ( with: URLRequest ( url: url) ) { data, response, error in
423420 if let error {
@@ -432,8 +429,6 @@ fileprivate extension URLSession {
432429 }
433430 . resume ( )
434431 }
435- #else
436- #error("Platform not supported")
437432 #endif
438433 }
439434}
0 commit comments