@@ -1367,7 +1367,9 @@ final class BuildPlanTests: XCTestCase {
13671367 Pkg . appending ( components: " Sources " , " exe " , " main.cpp " ) . pathString,
13681368 Pkg . appending ( components: " Sources " , " lib " , " lib.c " ) . pathString,
13691369 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
13711373 )
13721374
13731375 let observability = ObservabilitySystem . makeForTesting ( )
@@ -1382,6 +1384,9 @@ final class BuildPlanTests: XCTestCase {
13821384 targets: [
13831385 TargetDescription ( name: " exe " , dependencies: [ " lib " ] ) ,
13841386 TargetDescription ( name: " lib " , dependencies: [ ] ) ,
1387+ TargetDescription ( name: " swiftInteropLib " , dependencies: [ ] ,
1388+ settings: [ . init( tool: . swift, kind: . interoperabilityMode( . Cxx) ) ] ) ,
1389+ TargetDescription ( name: " swiftLib " , dependencies: [ ] )
13851390 ] ) ,
13861391 ] ,
13871392 observabilityScope: observability. topScope
@@ -1397,7 +1402,7 @@ final class BuildPlanTests: XCTestCase {
13971402 let result = try BuildPlanResult ( plan: plan)
13981403
13991404 result. checkProductsCount ( 1 )
1400- result. checkTargetsCount ( 2 )
1405+ result. checkTargetsCount ( 4 )
14011406
14021407 let buildPath = result. plan. buildParameters. dataPath. appending ( components: " debug " )
14031408
@@ -1447,6 +1452,11 @@ final class BuildPlanTests: XCTestCase {
14471452 let contents : String = try fs. readFileContents ( yaml)
14481453 XCTAssertMatch ( contents, . contains( #"-std=gnu99","-c"," \#( Pkg . appending ( components: " Sources " , " lib " , " lib.c " ) . escapedPathString ( ) ) "# ) )
14491454 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] )
14501460 }
14511461
14521462 func testSwiftCMixed( ) throws {
0 commit comments