Skip to content

[6.0] Add the formalized Swift Testing event stream arguments to swift test. #7770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 40 additions & 15 deletions Sources/Commands/SwiftTestCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,38 @@ struct SharedOptions: ParsableArguments {
var testProduct: String?
}

struct TestEventStreamOptions: ParsableArguments {
/// Legacy equivalent of ``configurationPath``.
@Option(name: .customLong("experimental-configuration-path"),
help: .private)
var experimentalConfigurationPath: AbsolutePath?

/// Path where swift-testing's JSON configuration should be read.
@Option(name: .customLong("configuration-path"),
help: .hidden)
var configurationPath: AbsolutePath?

/// Legacy equivalent of ``eventStreamOutputPath``.
@Option(name: .customLong("experimental-event-stream-output"),
help: .private)
var experimentalEventStreamOutputPath: AbsolutePath?

/// Path where swift-testing's JSON output should be written.
@Option(name: .customLong("event-stream-output-path"),
help: .hidden)
var eventStreamOutputPath: AbsolutePath?

/// Legacy equivalent of ``eventStreamVersion``.
@Option(name: .customLong("experimental-event-stream-version"),
help: .private)
var experimentalEventStreamVersion: Int?

/// The schema version of swift-testing's JSON input/output.
@Option(name: .customLong("event-stream-version"),
help: .hidden)
var eventStreamVersion: Int?
}

struct TestCommandOptions: ParsableArguments {
@OptionGroup()
var globalOptions: GlobalOptions
Expand All @@ -91,6 +123,10 @@ struct TestCommandOptions: ParsableArguments {
@OptionGroup()
var testLibraryOptions: TestLibraryOptions

/// Options for Swift Testing's event stream.
@OptionGroup()
var testEventStreamOptions: TestEventStreamOptions

/// If tests should run in parallel mode.
@Flag(name: .customLong("parallel"),
inversion: .prefixedNo,
Expand Down Expand Up @@ -155,21 +191,6 @@ struct TestCommandOptions: ParsableArguments {
var enableExperimentalTestOutput: Bool {
return testOutput == .experimentalSummary
}

/// Path where swift-testing's JSON configuration should be read.
@Option(name: .customLong("experimental-configuration-path"),
help: .hidden)
var configurationPath: AbsolutePath?

/// Path where swift-testing's JSON output should be written.
@Option(name: .customLong("experimental-event-stream-output"),
help: .hidden)
var eventStreamOutputPath: AbsolutePath?

/// The schema version of swift-testing's JSON input/output.
@Option(name: .customLong("experimental-event-stream-version"),
help: .hidden)
var eventStreamVersion: Int?
}

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

/// Options for Swift Testing's event stream.
@OptionGroup()
var testEventStreamOptions: TestEventStreamOptions

// for deprecated passthrough from SwiftTestTool (parse will fail otherwise)
@Flag(name: [.customLong("list-tests"), .customShort("l")], help: .hidden)
var _deprecated_passthrough: Bool = false
Expand Down