@@ -76,10 +76,6 @@ struct TestToolOptions: ParsableArguments {
76
76
help: " Lists test methods in specifier format " )
77
77
var _deprecated_shouldListTests : Bool = false
78
78
79
- /// Generate LinuxMain entries and exit.
80
- @Flag ( name: . customLong( " generate-linuxmain " ) , help: . hidden)
81
- var _deprecated_shouldGenerateLinuxMain : Bool = false
82
-
83
79
/// If the path of the exported code coverage JSON should be printed.
84
80
@Flag ( name: [ . customLong( " show-codecov-path " ) , . customLong( " show-code-coverage-path " ) , . customLong( " show-coverage-path " ) ] ,
85
81
help: " Print the path of the exported code coverage JSON file " )
@@ -146,7 +142,6 @@ public struct SwiftTestTool: SwiftCommand {
146
142
version: SwiftVersion . current. completeDisplayString,
147
143
subcommands: [
148
144
List . self,
149
- GenerateLinuxMain . self
150
145
] ,
151
146
helpNames: [ . short, . long, . customLong( " help " , withSingleDash: true ) ] )
152
147
@@ -181,10 +176,6 @@ public struct SwiftTestTool: SwiftCommand {
181
176
// backward compatibility 6/2022 for deprecation of flag into a subcommand
182
177
let command = try List . parse ( )
183
178
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)
188
179
} else if !self . options. shouldRunInParallel {
189
180
let toolchain = try swiftTool. getDestinationToolchain ( )
190
181
let testProducts = try buildTestsIfNeeded ( swiftTool: swiftTool)
@@ -435,10 +426,6 @@ public struct SwiftTestTool: SwiftCommand {
435
426
}
436
427
}
437
428
438
- if options. _deprecated_shouldGenerateLinuxMain {
439
- observabilityScope. emit ( warning: " '--generate-linuxmain' option is deprecated; tests are automatically discovered on all platforms " )
440
- }
441
-
442
429
if options. _deprecated_shouldListTests {
443
430
observabilityScope. emit ( warning: " '--list-tests' option is deprecated; use 'swift test list' instead " )
444
431
}
@@ -540,56 +527,6 @@ extension SwiftTestTool {
540
527
}
541
528
}
542
529
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
-
593
530
/// A structure representing an individual unit test.
594
531
struct UnitTest {
595
532
/// The path to the test product containing the test.
0 commit comments