swiftlang / swift-testing

A modern, expressive testing package for Swift
Apache License 2.0
1.81k stars 77 forks source link

Attachments! [Take 2] #796

Closed grynspan closed 2 weeks ago

grynspan commented 2 weeks ago

This PR introduces a new experimental feature, attachments. With this feature, you can "attach" values that conform to a new Test.Attachable protocol to a test. With the right command-line incantation (TBD), Swift Testing will automatically write attachments to disk for you.

[!NOTE] This PR does not teach Xcode or VS Code how to handle attachments produced by Swift Testing, nor does it add the necessary command-line arguments to the swift test command-line tool.

This PR is one of a series that I'll be posting to build out this feature.

As always, keep in mind that symbols marked @_spi(Experimental) are subject to change or removal without notice.

Resolves #714. Resolves rdar://88648735.

Checklist:

grynspan commented 2 weeks ago

@swift-ci test

grynspan commented 2 weeks ago

@swift-ci test Linux

grynspan commented 2 weeks ago

@swift-ci test macOS

grynspan commented 2 weeks ago

Reapplies #770 after it was reverted in #793.