Skip to content

Conversation

@stmontgomery
Copy link
Contributor

This merges the main branch into the release/6.2 branch.

Note: The Swift Testing project will be periodically performing "backwards" merges like this for a period which extends beyond the date when the 6.2 branches were cut, since nearly all contributions are intended to be included in the 6.2 release.

Once this PR has been merged, I will adjust the milestones on the PRs included in this merge to be 6.2 wherever appropriate.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

ADKaster and others added 8 commits May 13, 2025 11:20
)

The SwiftPM entry point is unstable and the new ABIv0 entry point has
already been added to the library.

### Motivation:

Using the SwiftPM entry point when building tests from a CMake project
as recommended in the documentation is outdated and unwise.

### Modifications:

Replace the example with one using the new ABIv0 entry point.

### Result:

CMake projects should stop relying on the SwiftPM entry point.

### 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.
CMake is a strange animal and some things are case sensitive, while
others aren't. It seems that `if(<condition>)` logical operator `OR` is
case sensitive, and `or` was not cutting it. At least for CMake 3.26.4.

If some CMake version allows `or`, it should also allow `OR`, so this
change should not be a problem for those versions.

Most of the time these pieces are not actually hit, because the build
system sets `SwiftTesting_MACROS` to `NO`, so this is skipped, which
might explain why it has not been a problem.
…ang#1116)

This enhances the console output message shown when a test run finishes
by including the total number of suites which ran or skipped, after the
total number of test functions. Example:

```
✔ Test run with 456 tests in 62 suites passed after 3.389 seconds.
```

The data was already being collected to support this, in a property
named `suiteCount`, but it was not being used anywhere. So this PR
adopts that property to augment the current "test run ended" message.

### 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.
A few refinements to `IssueHandlingTrait`, which is still SPI.

### Motivation:

Polish this SPI in anticipation of posting a pitch to promote it to
public API soon.

### Modifications:

- Expose a `handleIssue(_:)` instance method to allow more easily
composing multiple issue handling traits and calling their underlying
handler closure. This is conceptually similar to what was done for
[ST-0010: Public API to evaluate
ConditionTrait](https://github.com/swiftlang/swift-evolution/blob/main/proposals/testing/0010-evaluate-condition.md).
- Refine the names of private decls.
- Add `- Returns:` in DocC for places it's missing.

### 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.
…1124)

This removes the `triage-needed` label from the GitHub New Issue
templates in this repository which have it.

I added this while revamping these templates in swiftlang#962, but more recently
we added a `triaged` label which is works the opposite way—it's applied
after an issue has been triaged—so we don't need the older label
anymore.

### 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.
…th status and issue counts (swiftlang#1125)

This outputs a console message when each test case of a parameterized
test function ends, including its pass/fail status and a count of the
number of issues which were recorded, when running in verbose mode
(`swift test --verbose`).

Here's an example:

```
◇ Test contrivedExample(x:) started.
◇ Test case passing 1 argument x → 1 (Swift.Int) to contrivedExample(x:) started.
◇ Test case passing 1 argument x → 2 (Swift.Int) to contrivedExample(x:) started.
✔ Test case passing 1 argument x → 1 (Swift.Int) to contrivedExample(x:) passed after 0.001 seconds.
✘ Test contrivedExample(x:) recorded an issue with 1 argument x → 2 at EventRecorderTests.swift:759:3: Expectation failed: (x → 2) == 1
↳ x: Swift.Int → 2
↳ 1: Swift.Int → 1
✘ Test case passing 1 argument x → 2 (Swift.Int) to contrivedExample(x:) failed after 0.001 seconds with 1 issue.
✘ Test contrivedExample(x:) with 2 test cases failed after 0.001 seconds with 1 issue.
```

> Note: This leverages swiftlang#1000 which added more robust identification of
test cases.

Fixes swiftlang#1021
Fixes rdar://146863942

### 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.
… reveals (swiftlang#1126)

This enables the `InferIsolatedConformances` upcoming Swift feature from
[SE-0470: Global-actor isolated
conformances](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0470-isolated-conformances.md)
and fixes a couple of pre-existing issues it revealed.

I confirmed these code changes still build successfully using a Swift
6.1 toolchain.

### 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.
@stmontgomery stmontgomery added this to the Swift 6.2 milestone May 24, 2025
@stmontgomery stmontgomery self-assigned this May 24, 2025
@stmontgomery stmontgomery added the integration ⚙️ Integrating work to release branches label May 24, 2025
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@stmontgomery stmontgomery merged commit 9d38c66 into swiftlang:release/6.2 May 24, 2025
3 checks passed
@stmontgomery stmontgomery deleted the main-6.2-merge branch May 24, 2025 19:02
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.

4 participants