@@ -2207,7 +2207,7 @@ final class BuildPlanTests: XCTestCase {
2207
2207
] )
2208
2208
}
2209
2209
2210
- func testBinaryTargets( ) throws {
2210
+ func testBinaryTargets( platform : String , arch : String , destinationTriple : Triple ) throws {
2211
2211
let fs = InMemoryFileSystem ( emptyFiles:
2212
2212
" /Pkg/Sources/exe/main.swift " ,
2213
2213
" /Pkg/Sources/Library/Library.swift " ,
@@ -2227,15 +2227,15 @@ final class BuildPlanTests: XCTestCase {
2227
2227
<array>
2228
2228
<dict>
2229
2229
<key>LibraryIdentifier</key>
2230
- <string>macos-x86_64 </string>
2230
+ <string> \( platform ) - \( arch ) </string>
2231
2231
<key>LibraryPath</key>
2232
2232
<string>Framework.framework</string>
2233
2233
<key>SupportedArchitectures</key>
2234
2234
<array>
2235
- <string>x86_64 </string>
2235
+ <string> \( arch ) </string>
2236
2236
</array>
2237
2237
<key>SupportedPlatform</key>
2238
- <string>macos </string>
2238
+ <string> \( platform ) </string>
2239
2239
</dict>
2240
2240
</array>
2241
2241
<key>CFBundlePackageType</key>
@@ -2258,17 +2258,17 @@ final class BuildPlanTests: XCTestCase {
2258
2258
<array>
2259
2259
<dict>
2260
2260
<key>LibraryIdentifier</key>
2261
- <string>macos-x86_64 </string>
2261
+ <string> \( platform ) - \( arch ) </string>
2262
2262
<key>HeadersPath</key>
2263
2263
<string>Headers</string>
2264
2264
<key>LibraryPath</key>
2265
2265
<string>libStaticLibrary.a</string>
2266
2266
<key>SupportedArchitectures</key>
2267
2267
<array>
2268
- <string>x86_64 </string>
2268
+ <string> \( arch ) </string>
2269
2269
</array>
2270
2270
<key>SupportedPlatform</key>
2271
- <string>macos </string>
2271
+ <string> \( platform ) </string>
2272
2272
</dict>
2273
2273
</array>
2274
2274
<key>CFBundlePackageType</key>
@@ -2307,7 +2307,7 @@ final class BuildPlanTests: XCTestCase {
2307
2307
XCTAssertNoDiagnostics ( diagnostics)
2308
2308
2309
2309
let result = BuildPlanResult ( plan: try BuildPlan (
2310
- buildParameters: mockBuildParameters ( destinationTriple: . macOS ) ,
2310
+ buildParameters: mockBuildParameters ( destinationTriple: destinationTriple ) ,
2311
2311
graph: graph,
2312
2312
diagnostics: diagnostics,
2313
2313
fileSystem: fs
@@ -2335,14 +2335,22 @@ final class BuildPlanTests: XCTestCase {
2335
2335
2336
2336
let clibraryBasicArguments = try result. target ( for: " CLibrary " ) . clangTarget ( ) . basicArguments ( )
2337
2337
XCTAssertMatch ( clibraryBasicArguments, [ . anySequence, " -F " , " /path/to/build/debug " , . anySequence] )
2338
- XCTAssertMatch ( clibraryBasicArguments, [ . anySequence, " -I " , " /Pkg/StaticLibrary.xcframework/macos-x86_64 /Headers " , . anySequence] )
2338
+ XCTAssertMatch ( clibraryBasicArguments, [ . anySequence, " -I " , " /Pkg/StaticLibrary.xcframework/ \( platform ) - \( arch ) /Headers " , . anySequence] )
2339
2339
2340
2340
let clibraryLinkArguments = try result. buildProduct ( for: " CLibrary " ) . linkArguments ( )
2341
2341
XCTAssertMatch ( clibraryLinkArguments, [ . anySequence, " -F " , " /path/to/build/debug " , . anySequence] )
2342
2342
XCTAssertMatch ( clibraryLinkArguments, [ . anySequence, " -L " , " /path/to/build/debug " , . anySequence] )
2343
2343
XCTAssertMatch ( clibraryLinkArguments, [ " -lStaticLibrary " ] )
2344
2344
}
2345
2345
2346
+ func testBinaryTargets( ) throws {
2347
+ try testBinaryTargets ( platform: " macos " , arch: " x86_64 " , destinationTriple: . macOS)
2348
+ let arm64Triple = try Triple ( " arm64-apple-macosx " )
2349
+ try testBinaryTargets ( platform: " macos " , arch: " arm64 " , destinationTriple: arm64Triple)
2350
+ let arm64eTriple = try Triple ( " arm64e-apple-macosx " )
2351
+ try testBinaryTargets ( platform: " macos " , arch: " arm64e " , destinationTriple: arm64eTriple)
2352
+ }
2353
+
2346
2354
func testAddressSanitizer( ) throws {
2347
2355
try sanitizerTest ( . address, expectedName: " address " )
2348
2356
}
0 commit comments