@@ -259,6 +259,7 @@ final class BuildPlanTests: XCTestCase {
259259 let fs = InMemoryFileSystem ( emptyFiles:
260260 " /Pkg/Sources/exe/main.cpp " ,
261261 " /Pkg/Sources/lib/lib.c " ,
262+ " /Pkg/Sources/lib/libx.cpp " ,
262263 " /Pkg/Sources/lib/include/lib.h "
263264 )
264265 let pkg = PackageDescription4 . Package (
@@ -272,33 +273,39 @@ final class BuildPlanTests: XCTestCase {
272273 )
273274 let diagnostics = DiagnosticsEngine ( )
274275 let graph = loadMockPackageGraph4 ( [ " /Pkg " : pkg] , root: " /Pkg " , diagnostics: diagnostics, in: fs)
275- let result = BuildPlanResult ( plan: try BuildPlan ( buildParameters: mockBuildParameters ( ) , graph: graph, fileSystem: fs) )
276+ let plan = try BuildPlan ( buildParameters: mockBuildParameters ( ) , graph: graph, fileSystem: fs)
277+ let result = BuildPlanResult ( plan: plan)
276278
277279 result. checkProductsCount ( 1 )
278280 result. checkTargetsCount ( 2 )
279281
280- let lib = try result. target ( for: " lib " ) . clangTarget ( )
281- XCTAssertTrue ( lib. basicArguments ( ) . contains ( " -std=gnu99 " ) )
282-
283- let exe = try result. target ( for: " exe " ) . clangTarget ( )
284- XCTAssertTrue ( exe. basicArguments ( ) . contains ( " -std=c++1z " ) )
285-
286282 #if os(macOS)
287283 XCTAssertEqual ( try result. buildProduct ( for: " exe " ) . linkArguments ( ) , [
288284 " /fake/path/to/swiftc " , " -lc++ " , " -g " , " -L " , " /path/to/build/debug " , " -o " ,
289285 " /path/to/build/debug/exe " , " -module-name " , " exe " , " -emit-executable " ,
290286 " /path/to/build/debug/exe.build/main.cpp.o " ,
291- " /path/to/build/debug/lib.build/lib.c.o "
287+ " /path/to/build/debug/lib.build/lib.c.o " ,
288+ " /path/to/build/debug/lib.build/libx.cpp.o "
292289 ] )
293290 #else
294291 XCTAssertEqual ( try result. buildProduct ( for: " exe " ) . linkArguments ( ) , [
295292 " /fake/path/to/swiftc " , " -lstdc++ " , " -g " , " -L " , " /path/to/build/debug " , " -o " ,
296293 " /path/to/build/debug/exe " , " -module-name " , " exe " , " -emit-executable " ,
297294 " -Xlinker " , " -rpath=$ORIGIN " ,
298295 " /path/to/build/debug/exe.build/main.cpp.o " ,
299- " /path/to/build/debug/lib.build/lib.c.o "
296+ " /path/to/build/debug/lib.build/lib.c.o " ,
297+ " /path/to/build/debug/lib.build/libx.cpp.o "
300298 ] )
301299 #endif
300+
301+ mktmpdir { path in
302+ let yaml = path. appending ( component: " debug.yaml " )
303+ let llbuild = LLBuildManifestGenerator ( plan)
304+ try llbuild. generateManifest ( at: yaml)
305+ let contents = try localFileSystem. readFileContents ( yaml) . asString!
306+ XCTAssertTrue ( contents. contains ( " -std=gnu99 \" , \" -c \" , \" /Pkg/Sources/lib/lib.c " ) )
307+ XCTAssertTrue ( contents. contains ( " -std=c++1z \" , \" -c \" , \" /Pkg/Sources/lib/libx.cpp " ) )
308+ }
302309 }
303310
304311 func testSwiftCMixed( ) throws {
0 commit comments