Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split test skip conditionals up by responsibility #1745

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

plemarquand
Copy link
Contributor

The static functions on the SkipUnless utility are used to skip XCTests unless some condition is met.

Each of these methods effectively do two things:

  1. Check if the condition is met
  2. If not, skip the test using XCTSkip

To facilitate the adoption of swift-testing, these feature conditions need to be able to be checked without involving XCTest methods.

Break out the feature detection in to TestFeature, and have the methods on SkipUnless call these methods and then perform XCTSkip.

In the future when swift-testing begins to be adopted the logic in TestFeature can be used to build TestTraits that disable swift-testing tests.

The static functions on the `SkipUnless` utility are used to skip
XCTests unless some condition is met.

Each of these methods effectively do two things:

1) Check if the condition is met
2) If not, skip the test using `XCTSkip`

To facilitate the adoption of swift-testing these feature conditions
need to be able to be checked without involving XCTest methods.

Break out the feature detection in to `TestFeature`, and have the
methods on `SkipUnless` call these methods and then perform `XCTSkip`.

In the future when swift-testing begins to be adopted the logic in
TestFeature can be used to build TestTraits that disable swift-testing
tests.
@plemarquand plemarquand requested a review from ahoppen as a code owner October 9, 2024 19:38
@plemarquand plemarquand marked this pull request as draft October 10, 2024 12:44
@plemarquand
Copy link
Contributor Author

Swift-testing can't really be adopted until sourcekit-lsp drops support for Swift < 6.0, as swift-testing is only available in 6.0 and higher. Shelving this PR for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant