@@ -1367,7 +1367,9 @@ final class BuildPlanTests: XCTestCase {
1367
1367
Pkg . appending ( components: " Sources " , " exe " , " main.cpp " ) . pathString,
1368
1368
Pkg . appending ( components: " Sources " , " lib " , " lib.c " ) . pathString,
1369
1369
Pkg . appending ( components: " Sources " , " lib " , " libx.cpp " ) . pathString,
1370
- Pkg . appending ( components: " Sources " , " lib " , " include " , " lib.h " ) . pathString
1370
+ Pkg . appending ( components: " Sources " , " lib " , " include " , " lib.h " ) . pathString,
1371
+ Pkg . appending ( components: " Sources " , " swiftInteropLib " , " lib.swift " ) . pathString,
1372
+ Pkg . appending ( components: " Sources " , " swiftLib " , " lib.swift " ) . pathString
1371
1373
)
1372
1374
1373
1375
let observability = ObservabilitySystem . makeForTesting ( )
@@ -1382,6 +1384,9 @@ final class BuildPlanTests: XCTestCase {
1382
1384
targets: [
1383
1385
TargetDescription ( name: " exe " , dependencies: [ " lib " ] ) ,
1384
1386
TargetDescription ( name: " lib " , dependencies: [ ] ) ,
1387
+ TargetDescription ( name: " swiftInteropLib " , dependencies: [ ] ,
1388
+ settings: [ . init( tool: . swift, kind: . interoperabilityMode( . Cxx) ) ] ) ,
1389
+ TargetDescription ( name: " swiftLib " , dependencies: [ ] )
1385
1390
] ) ,
1386
1391
] ,
1387
1392
observabilityScope: observability. topScope
@@ -1397,7 +1402,7 @@ final class BuildPlanTests: XCTestCase {
1397
1402
let result = try BuildPlanResult ( plan: plan)
1398
1403
1399
1404
result. checkProductsCount ( 1 )
1400
- result. checkTargetsCount ( 2 )
1405
+ result. checkTargetsCount ( 4 )
1401
1406
1402
1407
let buildPath = result. plan. buildParameters. dataPath. appending ( components: " debug " )
1403
1408
@@ -1447,6 +1452,11 @@ final class BuildPlanTests: XCTestCase {
1447
1452
let contents : String = try fs. readFileContents ( yaml)
1448
1453
XCTAssertMatch ( contents, . contains( #"-std=gnu99","-c"," \#( Pkg . appending ( components: " Sources " , " lib " , " lib.c " ) . escapedPathString ( ) ) "# ) )
1449
1454
XCTAssertMatch ( contents, . contains( #"-std=c++1z","-c"," \#( Pkg . appending ( components: " Sources " , " lib " , " libx.cpp " ) . escapedPathString ( ) ) "# ) )
1455
+
1456
+ let swiftInteropLib = try result. target ( for: " swiftInteropLib " ) . swiftTarget ( ) . compileArguments ( )
1457
+ XCTAssertMatch ( swiftInteropLib, [ . anySequence, " -cxx-interoperability-mode=default " , " -Xcc " , " -std=c++1z " , . end] )
1458
+ let swiftLib = try result. target ( for: " swiftLib " ) . swiftTarget ( ) . compileArguments ( )
1459
+ XCTAssertNoMatch ( swiftLib, [ . anySequence, " -Xcc " , " -std=c++1z " , . anySequence] )
1450
1460
}
1451
1461
1452
1462
func testSwiftCMixed( ) throws {
0 commit comments