-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Copy helpers internally #8476
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
Copy helpers internally #8476
Conversation
Until swiftlang#8223 is fixed copy some helpers from `IntergrationTests/Source/IntegrationTests` to `Test/_InternalTestSupport` so we can re-use the functionality. Related to: swiftlang#8433 rdar://148248105 (cherry picked from commit e303b89)
@swift-ci test self hosted windows |
@swift-ci test |
@swift-ci test self hosted windows |
@swift-ci test windows |
This change was tested against the https://github.com/swiftlang/swift project in this swiftlang/swift#80717. |
@@ -0,0 +1,70 @@ | |||
|
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.
stray newline
|
||
extension Trait where Self == Testing.ConditionTrait { | ||
/// Skip test if the host operating system does not match the running OS. | ||
public static func requireHostOS(_ os: OperatingSystem, when condition: Bool = true) -> Self { |
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.
Is this used anywhere outside of this package? In general we try to stick to more restrictive package
if there's a need to use APIs in other modules of this same package. Otherwise there's a risk of accidentally and unnecessarily creating a public API that other packages may add as unintended and undesirable dependencies.
public static func requireHostOS(_ os: OperatingSystem, when condition: Bool = true) -> Self { | |
package static func requireHostOS(_ os: OperatingSystem, when condition: Bool = true) -> Self { |
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.
This is currently a helper. Nothing is using it at the moment, but the plan it to has Swift Testing tests use this traits when a test requires a specific host OS.
### Motivation: Pull request #8476 was breaking SwiftPM builds in Xcode (i.e., the _package resolution_ step): <img src="https://github.com/user-attachments/assets/2424e52c-1198-45c2-aa82-68c73ef5e9d6" width=600/> ### Modifications: This reverts commit 1d48e0a.
Until #8223 is fixed copy some helpers from
IntergrationTests/Source/IntegrationTests
toTest/_InternalTestSupport
so we can re-use the functionality.Related to: #8433
rdar://148248105
(cherry picked from commit e303b89)
Test with: swiftlang/swift#80717