Skip to content

Conversation

@grynspan
Copy link
Contributor

@grynspan grynspan commented Feb 25, 2025

This PR changes the signatures of the accessor functions for the test content metadata section so that we're not using underscored types. Instead, a Test.Generator type replaces Test._Record and the bare function type we were using for Test and ExitTest is promoted to (still experimental) API instead of hiding behind underscores.

This change allows the types produced by accessor functions to always be nominal types, avoids the iffy substitution of _Record for @Sendable () async -> Test at runtime, and simplifies the internal TestContent protocol by eliminating the need for an associated type to stand in for the conforming type.

This change leaves ExitTest as a nominal, but empty, type. I've added ExitTest.current to make it useful so that test code, especially libraries, can detect if it's running inside an exit test or not. I will separately update the exit test proposal PR to include this type and property.

Checklist:

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

…urrent`.

This PR changes the signatures of the accessor functions for the test content
metadata section so that we're not using underscored types. Instead, a
`Test.Generator` type replaces `Test._Record` and the bare function type we were
using for `Test` and `ExitTest` is promoted to (still experimental) API instead
of hiding behind underscores.

This change allows the types produced by accessor functions to always be nominal
types, avoids the iffy substitution of `_Record` for `@Sendable () async -> Test`
at runtime, and simplifies the internal `TestContent` protocol by eliminating
the need for an associated type to stand in for the conforming type.

This change leaves `ExitTest` as a nominal, but empty, type. I've added
`ExitTest.current` to make it useful so that test code, especially libraries,
can detect if it's running inside an exit test or not. I will separately update
the exit test proposal PR to include this type and property.
@grynspan grynspan added tools integration 🛠️ Integration of swift-testing into tools/IDEs public-api Affects public API exit-tests ☠️ Work related to exit tests labels Feb 25, 2025
@grynspan grynspan added this to the Swift 6.x milestone Feb 25, 2025
@grynspan grynspan self-assigned this Feb 25, 2025
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan merged commit a7b5435 into main Feb 25, 2025
3 checks passed
@grynspan grynspan deleted the jgrynspan/tweak-abi-accessor-types branch February 25, 2025 21:32
@grynspan grynspan added the discovery 🔎 test content discovery label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discovery 🔎 test content discovery exit-tests ☠️ Work related to exit tests public-api Affects public API tools integration 🛠️ Integration of swift-testing into tools/IDEs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants