Skip to content

Commit 861a871

Browse files
authored
Add swift test --attachments-path. (#8492)
This PR adds support for the `--attachments-path` CLI argument on `swift test` as approved in [ST-0009](https://github.com/swiftlang/swift-evolution/blob/main/proposals/testing/0009-attachments.md). We will maintain support for the older `--experimental-attachments-path` version through Swift 6.2. The implementation of this option is held entirely in Swift Testing at this time, so no actual code is needed to support it, we just need to make sure Swift Argument Parser doesn't complain about it. Resolves rdar://147753584. @plemarquand has integration tests but they're blocked on a newer toolchain; unit testing of this argument exists in the Swift Testing repo.
1 parent e842b0e commit 861a871

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/Commands/SwiftTestCommand.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ struct TestEventStreamOptions: ParsableArguments {
124124
@Option(name: .customLong("experimental-attachments-path"),
125125
help: .private)
126126
var experimentalAttachmentsPath: AbsolutePath?
127+
128+
/// Path for writing attachments (Swift Testing only.)
129+
@Option(name: .customLong("attachments-path"),
130+
help: "Path where attachments should be written (Swift Testing only). This path must be an existing directory the current user can write to. If not specified, any attachments created during testing are discarded.")
131+
var attachmentsPath: AbsolutePath?
127132
}
128133

129134
struct TestCommandOptions: ParsableArguments {

0 commit comments

Comments
 (0)