Skip to content

Commit 8ca3091

Browse files
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 <m_desiatov@apple.com>
1 parent a37631a commit 8ca3091

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.
@@ -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)