@@ -76,10 +76,6 @@ struct TestToolOptions: ParsableArguments {
7676 help: " Lists test methods in specifier format " )
7777 var _deprecated_shouldListTests : Bool = false
7878
79- /// Generate LinuxMain entries and exit.
80- @Flag ( name: . customLong( " generate-linuxmain " ) , help: . hidden)
81- var _deprecated_shouldGenerateLinuxMain : Bool = false
82-
8379 /// If the path of the exported code coverage JSON should be printed.
8480 @Flag ( name: [ . customLong( " show-codecov-path " ) , . customLong( " show-code-coverage-path " ) , . customLong( " show-coverage-path " ) ] ,
8581 help: " Print the path of the exported code coverage JSON file " )
@@ -146,7 +142,6 @@ public struct SwiftTestTool: SwiftCommand {
146142 version: SwiftVersion . current. completeDisplayString,
147143 subcommands: [
148144 List . self,
149- GenerateLinuxMain . self
150145 ] ,
151146 helpNames: [ . short, . long, . customLong( " help " , withSingleDash: true ) ] )
152147
@@ -181,10 +176,6 @@ public struct SwiftTestTool: SwiftCommand {
181176 // backward compatibility 6/2022 for deprecation of flag into a subcommand
182177 let command = try List . parse ( )
183178 try command. run ( swiftTool)
184- } else if self . options. _deprecated_shouldGenerateLinuxMain {
185- // backward compatibility 6/2022 for deprecation of flag into a subcommand
186- let command = try GenerateLinuxMain . parse ( )
187- try command. run ( swiftTool)
188179 } else if !self . options. shouldRunInParallel {
189180 let toolchain = try swiftTool. getDestinationToolchain ( )
190181 let testProducts = try buildTestsIfNeeded ( swiftTool: swiftTool)
@@ -435,10 +426,6 @@ public struct SwiftTestTool: SwiftCommand {
435426 }
436427 }
437428
438- if options. _deprecated_shouldGenerateLinuxMain {
439- observabilityScope. emit ( warning: " '--generate-linuxmain' option is deprecated; tests are automatically discovered on all platforms " )
440- }
441-
442429 if options. _deprecated_shouldListTests {
443430 observabilityScope. emit ( warning: " '--list-tests' option is deprecated; use 'swift test list' instead " )
444431 }
@@ -540,56 +527,6 @@ extension SwiftTestTool {
540527 }
541528}
542529
543- extension SwiftTestTool {
544- // this functionality is deprecated as of 12/2020
545- // but we are keeping it here for transition purposes
546- // to be removed in future releases
547- // deprecation warning is emitted by validateArguments
548- struct GenerateLinuxMain : SwiftCommand {
549- static let configuration = CommandConfiguration (
550- commandName: " generate-linuxmain " ,
551- abstract: " Generate LinuxMain.swift (deprecated) "
552- )
553-
554- @OptionGroup ( visibility: . hidden)
555- var globalOptions : GlobalOptions
556-
557- // for deprecated passthrough from SwiftTestTool (parse will fail otherwise)
558- @Flag ( name: . customLong( " generate-linuxmain " ) , help: . hidden)
559- var _deprecated_passthrough : Bool = false
560-
561- func run( _ swiftTool: SwiftTool ) throws {
562- #if os(Linux)
563- swiftTool. observabilityScope. emit ( warning: " can't discover tests on Linux; please use this option on macOS instead " )
564- #endif
565- let graph = try swiftTool. loadPackageGraph ( )
566- let testProducts = try buildTests ( swiftTool: swiftTool)
567- let testSuites = try TestingSupport . getTestSuites (
568- in: testProducts,
569- swiftTool: swiftTool,
570- enableCodeCoverage: false ,
571- sanitizers: globalOptions. build. sanitizers
572- )
573- let allTestSuites = testSuites. values. flatMap { $0 }
574- let generator = LinuxMainGenerator ( graph: graph, testSuites: allTestSuites)
575- try generator. generate ( )
576- }
577-
578- private func buildTests( swiftTool: SwiftTool ) throws -> [ BuiltTestProduct ] {
579- let buildParameters = try swiftTool. buildParametersForTest ( enableCodeCoverage: false )
580- let buildSystem = try swiftTool. createBuildSystem ( customBuildParameters: buildParameters)
581-
582- try buildSystem. build ( subset: . allIncludingTests)
583-
584- guard !buildSystem. builtTestProducts. isEmpty else {
585- throw TestError . testsExecutableNotFound
586- }
587-
588- return buildSystem. builtTestProducts
589- }
590- }
591- }
592-
593530/// A structure representing an individual unit test.
594531struct UnitTest {
595532 /// The path to the test product containing the test.
0 commit comments