@@ -3518,13 +3518,56 @@ final class SwiftDriverTests: XCTestCase {
3518
3518
XCTAssertTrue ( verifyJob. inputs [ 0 ] == mergeInterfaceOutputs [ 0 ] )
3519
3519
XCTAssertTrue ( verifyJob. commandLine. contains ( . path( mergeInterfaceOutputs [ 0 ] . file) ) )
3520
3520
}
3521
+
3521
3522
// No Evolution
3522
3523
do {
3523
3524
var driver = try Driver ( args: [ " swiftc " , " foo.swift " , " -emit-module " , " -module-name " ,
3524
3525
" foo " , " -emit-module-interface " , " -verify-emitted-module-interface " ] )
3525
3526
let plannedJobs = try driver. planBuild ( )
3526
3527
XCTAssertEqual ( plannedJobs. count, 2 )
3527
3528
}
3529
+
3530
+ // Emit-module separately
3531
+ do {
3532
+ var driver = try Driver ( args: [ " swiftc " , " foo.swift " , " -emit-module " , " -module-name " ,
3533
+ " foo " , " -emit-module-interface " ,
3534
+ " -verify-emitted-module-interface " ,
3535
+ " -enable-library-evolution " ,
3536
+ " -experimental-emit-module-separately " ] )
3537
+ let plannedJobs = try driver. planBuild ( )
3538
+ XCTAssertEqual ( plannedJobs. count, 2 )
3539
+ let emitJob = plannedJobs [ 0 ]
3540
+ let verifyJob = plannedJobs [ 1 ]
3541
+ XCTAssertEqual ( emitJob. kind, . emitModule)
3542
+ let emitInterfaceOutput = emitJob. outputs. filter { $0. type == . swiftInterface }
3543
+ XCTAssertTrue ( emitInterfaceOutput. count == 1 ,
3544
+ " Emit module job should only have one swiftinterface output " )
3545
+ XCTAssertEqual ( verifyJob. kind, . verifyModuleInterface)
3546
+ XCTAssertTrue ( verifyJob. inputs. count == 1 )
3547
+ XCTAssertTrue ( verifyJob. inputs [ 0 ] == emitInterfaceOutput [ 0 ] )
3548
+ XCTAssertTrue ( verifyJob. commandLine. contains ( . path( emitInterfaceOutput [ 0 ] . file) ) )
3549
+ }
3550
+
3551
+ // Whole-module
3552
+ do {
3553
+ var driver = try Driver ( args: [ " swiftc " , " foo.swift " , " -emit-module " , " -module-name " ,
3554
+ " foo " , " -emit-module-interface " ,
3555
+ " -verify-emitted-module-interface " ,
3556
+ " -enable-library-evolution " ,
3557
+ " -whole-module-optimization " ] )
3558
+ let plannedJobs = try driver. planBuild ( )
3559
+ XCTAssertEqual ( plannedJobs. count, 2 )
3560
+ let emitJob = plannedJobs [ 0 ]
3561
+ let verifyJob = plannedJobs [ 1 ]
3562
+ XCTAssertEqual ( emitJob. kind, . emitModule)
3563
+ let emitInterfaceOutput = emitJob. outputs. filter { $0. type == . swiftInterface }
3564
+ XCTAssertTrue ( emitInterfaceOutput. count == 1 ,
3565
+ " Emit module job should only have one swiftinterface output " )
3566
+ XCTAssertEqual ( verifyJob. kind, . verifyModuleInterface)
3567
+ XCTAssertTrue ( verifyJob. inputs. count == 1 )
3568
+ XCTAssertTrue ( verifyJob. inputs [ 0 ] == emitInterfaceOutput [ 0 ] )
3569
+ XCTAssertTrue ( verifyJob. commandLine. contains ( . path( emitInterfaceOutput [ 0 ] . file) ) )
3570
+ }
3528
3571
}
3529
3572
3530
3573
func testPCHGeneration( ) throws {
0 commit comments