Skip to content

Commit 125b3eb

Browse files
authored
Add the formalized Swift Testing event stream arguments to swift test. (swiftlang#7768)
1 parent 02f37e4 commit 125b3eb

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,
@@ -156,21 +192,6 @@ struct TestCommandOptions: ParsableArguments {
156192
return testOutput == .experimentalSummary
157193
}
158194

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?
173-
174195
@OptionGroup(visibility: .hidden)
175196
package var traits: TraitOptions
176197
}
@@ -656,6 +677,10 @@ extension SwiftTestCommand {
656677
@OptionGroup()
657678
var testLibraryOptions: TestLibraryOptions
658679

680+
/// Options for Swift Testing's event stream.
681+
@OptionGroup()
682+
var testEventStreamOptions: TestEventStreamOptions
683+
659684
@OptionGroup(visibility: .hidden)
660685
package var traits: TraitOptions
661686

0 commit comments

Comments
 (0)