@@ -518,29 +518,30 @@ class MiscellaneousTestCase: XCTestCase {
518
518
}
519
519
520
520
func testEnableTestDiscoveryDeprecation( ) throws {
521
+ let compilerDiagnosticFlags = [ " -Xswiftc " , " -Xfrontend " , " -Xswiftc " , " -Rmodule-interface-rebuild " ]
521
522
#if canImport(Darwin)
522
523
// should emit when LinuxMain is present
523
524
fixture ( name: " Miscellaneous/TestDiscovery/Simple " ) { path in
524
- let ( _, stderr) = try SwiftPMProduct . SwiftTest. execute ( [ " --enable-test-discovery " ] , packagePath: path)
525
+ let ( _, stderr) = try SwiftPMProduct . SwiftTest. execute ( [ " --enable-test-discovery " ] + compilerDiagnosticFlags , packagePath: path)
525
526
XCTAssertMatch ( stderr, . contains( " warning: '--enable-test-discovery' option is deprecated " ) )
526
527
}
527
528
528
529
// should emit when LinuxMain is not present
529
530
fixture ( name: " Miscellaneous/TestDiscovery/Simple " ) { path in
530
531
try localFileSystem. writeFileContents ( path. appending ( components: " Tests " , SwiftTarget . testManifestNames. first!) , bytes: " fatalError( \" boom \" ) " )
531
- let ( _, stderr) = try SwiftPMProduct . SwiftTest. execute ( [ " --enable-test-discovery " ] , packagePath: path)
532
+ let ( _, stderr) = try SwiftPMProduct . SwiftTest. execute ( [ " --enable-test-discovery " ] + compilerDiagnosticFlags , packagePath: path)
532
533
XCTAssertMatch ( stderr, . contains( " warning: '--enable-test-discovery' option is deprecated " ) )
533
534
}
534
535
#else
535
536
// should emit when LinuxMain is present
536
537
fixture ( name: " Miscellaneous/TestDiscovery/Simple " ) { path in
537
- let ( _, stderr) = try SwiftPMProduct . SwiftTest. execute ( [ " --enable-test-discovery " ] , packagePath: path)
538
+ let ( _, stderr) = try SwiftPMProduct . SwiftTest. execute ( [ " --enable-test-discovery " ] + compilerDiagnosticFlags , packagePath: path)
538
539
XCTAssertMatch ( stderr, . contains( " warning: '--enable-test-discovery' option is deprecated " ) )
539
540
}
540
541
// should not emit when LinuxMain is present
541
542
fixture ( name: " Miscellaneous/TestDiscovery/Simple " ) { path in
542
543
try localFileSystem. writeFileContents ( path. appending ( components: " Tests " , SwiftTarget . testManifestNames. first!) , bytes: " fatalError( \" boom \" ) " )
543
- let ( _, stderr) = try SwiftPMProduct . SwiftTest. execute ( [ " --enable-test-discovery " ] , packagePath: path)
544
+ let ( _, stderr) = try SwiftPMProduct . SwiftTest. execute ( [ " --enable-test-discovery " ] + compilerDiagnosticFlags , packagePath: path)
544
545
XCTAssertNoMatch ( stderr, . contains( " warning: '--enable-test-discovery' option is deprecated " ) )
545
546
}
546
547
#endif
0 commit comments