Skip to content

Commit d74835b

Browse files
committed
Add the formalized Swift Testing event stream arguments to swift test. (#7768)
1 parent c04a8b0 commit d74835b

File tree

1 file changed

+40
-15
lines changed

1 file changed

+40
-15
lines changed

Sources/Commands/SwiftTestCommand.swift

+40-15
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,38 @@ struct SharedOptions: ParsableArguments {
8080
var testProduct: String?
8181
}
8282

83+
struct TestEventStreamOptions: ParsableArguments {
84+
/// Legacy equivalent of ``configurationPath``.
85+
@Option(name: .customLong("experimental-configuration-path"),
86+
help: .private)
87+
var experimentalConfigurationPath: AbsolutePath?
88+
89+
/// Path where swift-testing's JSON configuration should be read.
90+
@Option(name: .customLong("configuration-path"),
91+
help: .hidden)
92+
var configurationPath: AbsolutePath?
93+
94+
/// Legacy equivalent of ``eventStreamOutputPath``.
95+
@Option(name: .customLong("experimental-event-stream-output"),
96+
help: .private)
97+
var experimentalEventStreamOutputPath: AbsolutePath?
98+
99+
/// Path where swift-testing's JSON output should be written.
100+
@Option(name: .customLong("event-stream-output-path"),
101+
help: .hidden)
102+
var eventStreamOutputPath: AbsolutePath?
103+
104+
/// Legacy equivalent of ``eventStreamVersion``.
105+
@Option(name: .customLong("experimental-event-stream-version"),
106+
help: .private)
107+
var experimentalEventStreamVersion: Int?
108+
109+
/// The schema version of swift-testing's JSON input/output.
110+
@Option(name: .customLong("event-stream-version"),
111+
help: .hidden)
112+
var eventStreamVersion: Int?
113+
}
114+
83115
struct TestCommandOptions: ParsableArguments {
84116
@OptionGroup()
85117
var globalOptions: GlobalOptions
@@ -91,6 +123,10 @@ struct TestCommandOptions: ParsableArguments {
91123
@OptionGroup()
92124
var testLibraryOptions: TestLibraryOptions
93125

126+
/// Options for Swift Testing's event stream.
127+
@OptionGroup()
128+
var testEventStreamOptions: TestEventStreamOptions
129+
94130
/// If tests should run in parallel mode.
95131
@Flag(name: .customLong("parallel"),
96132
inversion: .prefixedNo,
@@ -155,21 +191,6 @@ struct TestCommandOptions: ParsableArguments {
155191
var enableExperimentalTestOutput: Bool {
156192
return testOutput == .experimentalSummary
157193
}
158-
159-
/// Path where swift-testing's JSON configuration should be read.
160-
@Option(name: .customLong("experimental-configuration-path"),
161-
help: .hidden)
162-
var configurationPath: AbsolutePath?
163-
164-
/// Path where swift-testing's JSON output should be written.
165-
@Option(name: .customLong("experimental-event-stream-output"),
166-
help: .hidden)
167-
var eventStreamOutputPath: AbsolutePath?
168-
169-
/// The schema version of swift-testing's JSON input/output.
170-
@Option(name: .customLong("experimental-event-stream-version"),
171-
help: .hidden)
172-
var eventStreamVersion: Int?
173194
}
174195

175196
/// Tests filtering specifier, which is used to filter tests to run.
@@ -653,6 +674,10 @@ extension SwiftTestCommand {
653674
@OptionGroup()
654675
var testLibraryOptions: TestLibraryOptions
655676

677+
/// Options for Swift Testing's event stream.
678+
@OptionGroup()
679+
var testEventStreamOptions: TestEventStreamOptions
680+
656681
// for deprecated passthrough from SwiftTestTool (parse will fail otherwise)
657682
@Flag(name: [.customLong("list-tests"), .customShort("l")], help: .hidden)
658683
var _deprecated_passthrough: Bool = false

0 commit comments

Comments
 (0)