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

Enable tests for SwiftPM #382

Closed
wants to merge 3 commits into from
Closed

Enable tests for SwiftPM #382

wants to merge 3 commits into from

Conversation

helje5
Copy link

@helje5 helje5 commented Nov 15, 2019

A way to enable tests even when building w/ SwiftPM.

Only two tests fail (on macOS):

  • testAvailableFeatures
  • testImageTinting

Some tests are not guarded for UIKit.
Instead of using `image(forResource:)`, use an own
`testImage(forResource:)` which allows us to override
the lookup behaviour when building w/ SwiftPM.
... which doesn't even have UXImage 🙄 ;-)
@chrisballinger chrisballinger changed the base branch from feature/zeveisenberg/swiftpm to master February 1, 2020 01:21
@chrisballinger chrisballinger changed the title Feature/hh/swiftpm Enable tests for SwiftPM Feb 1, 2020
@chrisballinger
Copy link
Contributor

Thanks for the PR! This is an interesting and awesome workaround for the "SPM packages can't include resources" issue. SE-0271 will resolve this problem at the source, so it might be better to put this on pause until resource bundles are officially supported in SPM.

@chrisballinger
Copy link
Contributor

Looks like this is resolved in Swift 5.3, would love to get this updated and merged once that's out: https://github.com/apple/swift-evolution/blob/master/proposals/0271-package-manager-resources.md

@chrisballinger
Copy link
Contributor

This should now be possible to do without hacks in Xcode 12.2 using the new Swift 5.3 SPM toolchain for bundled resources.

@ZevEisenberg
Copy link
Collaborator

It looks like there's a bug related to bundled resources and test targets specifically. Not sure if this is going to be fixed in Xcode 12.5, but it doesn't seem to be in the betas. swiftlang/swift-package-manager#2905

@chrisballinger
Copy link
Contributor

Finally shipped in #411 #412

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.

3 participants