Skip to content

Merge main into release/6.4.x#1727

Merged
stmontgomery merged 4 commits into
release/6.4.xfrom
automerge/merge-main-2026-05-25_10-39
May 27, 2026
Merged

Merge main into release/6.4.x#1727
stmontgomery merged 4 commits into
release/6.4.xfrom
automerge/merge-main-2026-05-25_10-39

Conversation

@github-actions
Copy link
Copy Markdown

This PR was automatically opened by a GitHub action. Review the changes included in this PR and determine if they should be included in the release branch. If yes, merge the PR. Otherwise revert changes that should not be included on this branch.

grynspan and others added 4 commits May 20, 2026 11:27
This PR adds helper members on `Trait` to allow casting between the
different refining protocols and concrete trait types without relying on
`as?` in Embedded Swift.

I have left an `as? TimeLimitTrait` cast unmodified as I expect we won't
support time limits in Embedded Swift and will probably just stub out
that whole type.

### Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
Add more concrete overloads of `String(describingForTest:)` and
`appendInterpolation(_:)` to eliminate more string-related diagnostics.
And a few other related changes.

### Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
Enable targeted interoperability by default

### Motivation:

Interoperability is a feature that makes it safer and easier than ever
to migrate from XCTest to Swift Testing.

It does this by addressing the problem of "lossy without interop", where
issues created by XCTest are normally not handled in a Swift Testing
test.

Interop supports a few modes:

    class FooTests: XCTestCase {
        func testInterop() {
        // None:     No-op
        // Limited:  ❌ "Interop failure"
        // Complete: ❌ "Interop failure"
        // Strict:   ❌ "Interop failure"
        Issue.record("Interop failure")
        }
    }

    @test func `Test Interop`() {
        // None:     No-op
// Limited: ⚠️ "Interop failure", ⚠️ Adopt Swift Testing primitives
// Complete: ❌ "Interop failure", ⚠️ Adopt Swift Testing primitives
        // Strict:   💥 fatalError: Adopt Swift Testing primitives
        XCTFail("Interop failure")
    }

The default is "complete" for `swift-tools-version: 6.4`[^1] and
"limited" otherwise.

Use env var `SWIFT_TESTING_XCTEST_INTEROP_MODE=<mode in lowercase>` to
override this mode at runtime.

[^1]: swiftlang/swift-package-manager#9857

To learn more, refer to the full proposal:

https://github.com/swiftlang/swift-evolution/blob/main/proposals/testing/0021-targeted-interoperability-swift-testing-and-xctest.md

### Modifications:

* Remove SWT_EXPERIMENTAL_INTEROP_ENABLED flag and related checks. This
ensures that interoperability Just Works when you use a toolchain that
supports it.

* Add SWIFT_TESTING_XCTEST_INTEROP_MODE to EnvironmentVariables.md

Resolves rdar://177175523

## Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.

---------

Co-authored-by: Stuart Montgomery <smontgomery@apple.com>
@stmontgomery stmontgomery self-assigned this May 27, 2026
@stmontgomery stmontgomery added the integration ⚙️ Integrating work to release branches label May 27, 2026
@stmontgomery stmontgomery added this to the Swift 6.4.0 (main) milestone May 27, 2026
@stmontgomery stmontgomery marked this pull request as ready for review May 27, 2026 02:33
@stmontgomery stmontgomery merged commit a30bb02 into release/6.4.x May 27, 2026
35 checks passed
@stmontgomery stmontgomery deleted the automerge/merge-main-2026-05-25_10-39 branch May 27, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration ⚙️ Integrating work to release branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants