I'm encountering a fatal error when running tests on a framework which depends on a Swift Package that is trying to load its resource bundle using `Bundle.module`. Attached is a sample project that can reproduce the error by running the tests on the PhoneEntryKit target.
- PhoneEntryKit framework depends on PhoneNumberKit Swift Package
- PhoneEntryKitTest target uses PhoneNumberEntry app as its test host
- PhoneEntryKit uses a type from PhoneNumberKit which attempts to load a resource from the resource bundle generated by Swift Package Manager.
The built products when running the tests in Xcode yields the xctest bundle inside of the test host's Plugins directory, but the generated accessor for `Bundle.module` doesn't account for that situation, which leads to the fatal error (https://github.com/apple/swift-package-manager/blob/1f2eda34deec3c92b97d116f192fd734657c4613/Sources/Build/BuildPlan.swift#L639).
I've tried this both in Xcode 12.4 as well as 12.5 beta 3.