Skip to content

Commit dd4d96b

Browse files
grynspanMaxDesiatov
authored andcommitted
Pass through swift-testing's experimental JSON streams from swift test (swiftlang#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 4d87f33 commit dd4d96b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Diff for: Sources/Commands/SwiftTestCommand.swift

+12-1
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.
@@ -688,9 +698,10 @@ extension SwiftTestCommand {
688698
sanitizers: globalOptions.build.sanitizers
689699
)
690700

701+
let additionalArguments = ["--list-tests"] + CommandLine.arguments.dropFirst()
691702
let runner = TestRunner(
692703
bundlePaths: testProducts.map(\.binaryPath),
693-
additionalArguments: ["--list-tests"],
704+
additionalArguments: additionalArguments,
694705
cancellator: swiftCommandState.cancellator,
695706
toolchain: toolchain,
696707
testEnv: testEnv,

0 commit comments

Comments
 (0)