[swift-build-dev] SwiftPM Test Fixtures

Daniel Dunbar daniel_dunbar at apple.com
Fri Nov 18 11:03:32 CST 2016

The way that we have been doing this is by using `#file` to derive the location of the test data. It is gross, but it works until we have a real resource story.

 - Daniel

> On Nov 17, 2016, at 7:07 PM, Ryan Lovelett via swift-build-dev <swift-build-dev at swift.org> wrote:
> If I have a number of `*.json` files that are meant to be loaded and
> used as a part of my SwiftPM test suite:
> 1. how do I get SwiftPM to bundle them with the test bundle?
> 2. how do I reference the fixtures in the test bundle?
> ## What I've tried...
> I tried creating a top-level directory called `Fixtures`.  Then
> referencing the bundle with something like:
> `Bundle.allBundles.first(where: { $0.bundlePath.hasSuffix(".xctest")
> })!.bundleURL`.
> Is this even possible?
> _______________________________________________
> swift-build-dev mailing list
> swift-build-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-build-dev

More information about the swift-build-dev mailing list