Skip to content

Commit ef756c9

Browse files
grynspanMaxDesiatov
andcommitted
Pass through swift-testing's experimental JSON streams from swift test (#7534)
This PR adds two undocumented/unsupported experimental options to `swift test` to allow passing through JSON files/streams for input and output. These streams are still under development in swift-testing, so these options are not yet supported, but this change will allow interested coders to experiment with them. --------- Co-authored-by: Max Desiatov <[email protected]>
1 parent 4f19176 commit ef756c9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Sources/Commands/SwiftTestCommand.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ struct TestCommandOptions: ParsableArguments {
154154
var enableExperimentalTestOutput: Bool {
155155
return testOutput == .experimentalSummary
156156
}
157+
158+
/// Path where swift-testing's JSON configuration should be read.
159+
@Option(name: .customLong("experimental-configuration-path"),
160+
help: .hidden)
161+
var configurationPath: AbsolutePath?
162+
163+
/// Path where swift-testing's JSON output should be written.
164+
@Option(name: .customLong("experimental-event-stream-output"),
165+
help: .hidden)
166+
var eventStreamOutputPath: AbsolutePath?
157167
}
158168

159169
/// Tests filtering specifier, which is used to filter tests to run.
@@ -682,9 +692,10 @@ extension SwiftTestCommand {
682692
sanitizers: globalOptions.build.sanitizers
683693
)
684694

695+
let additionalArguments = ["--list-tests"] + CommandLine.arguments.dropFirst()
685696
let runner = TestRunner(
686697
bundlePaths: testProducts.map(\.binaryPath),
687-
additionalArguments: ["--list-tests"],
698+
additionalArguments: additionalArguments,
688699
cancellator: swiftCommandState.cancellator,
689700
toolchain: toolchain,
690701
testEnv: testEnv,

0 commit comments

Comments
 (0)