-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Test: Add platform helpers #8099
base: main
Are you sure you want to change the base?
Conversation
Ready for review, though it may be blocked as not all pipeline builds run with Swift 6.0! |
3702870
to
8b71a84
Compare
This PR is blocked by #8137 |
8b71a84
to
afa76d9
Compare
Please test with following pull request: @swift-ci Please test |
Be aware: this won't work reliably for tests where the test content is only compilable on one platform or another. |
@grynspan : Could you please clarify |
arguments: [ | ||
(name: "", expected: false), | ||
(name: "DOES_NOT_EXIST", expected: false), | ||
(name: "HOME", expected: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@swift-ci please test |
Add helpers related to the current platform to assist with conditionally running test cases.
afa76d9
to
ba51fbf
Compare
@swift-ci please test |
@swift-ci please test windows |
1 similar comment
@swift-ci please test windows |
Add helpers related to the current platform to assist with conditionally running test cases.
Motivation:
Some XCTests have the following implementation, or a variation thereof
The idiomatic Swift Testing is to use the
enabled
/disabled
traits, thus allowing the test to be compiled. As such, create some helpers function. that will allow enabling/disabling a test using these helper functions.Modifications:
Add helper functions and add some Swift Testing tests.
Result:
Ran the equivalent of the following and ensured there were no test-related failures
Blocked by #8137
Requires swiftlang/swift#78300