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

[SR-11375] generate-linuxmain doesn't respect compilation conditions #4671

Closed
jackhl opened this issue Aug 26, 2019 · 1 comment
Closed

[SR-11375] generate-linuxmain doesn't respect compilation conditions #4671

jackhl opened this issue Aug 26, 2019 · 1 comment
Labels

Comments

@jackhl
Copy link
Member

jackhl commented Aug 26, 2019

Previous ID SR-11375
Radar None
Original Reporter @jackhl
Type Bug
Status Resolved
Resolution Won't Do
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 22448975392a33d1f126197702b87fbe

Issue Description:

When I wrap a test class or test function in a compilation condition that fails on linux, generate-linuxmain still includes the test. This completely breaks usage of generate-linuxmain for us as there's no way to exclude the tests without manually editing the manifests every time we update them. For example:

#if canImport(AppKit)
import AppKit
class MyTests: XCTestCase {
    func testStuff() { }
}
#endif
@ankitspd
Copy link
Member

`generate-linuxmain` relies on Darwin runtime reflection so it will evaluate canImport for AppKit as true. I recommend wrapping the test body in the conditional so it becomes an empty test on Linux.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants