Currently, when opening Package.swift instead of the project file in Xcode, or when running swift test from command-line on macOS, the tests fail. This is caused by the lack of support for test bundle resources in SwiftPM. This can be easily fixed by inferring the test file path from the #file value. Additionally, this behaviour is cross-platform and doesn't require special handling on Linux.
Currently, when opening
Package.swift
instead of the project file in Xcode, or when runningswift test
from command-line on macOS, the tests fail. This is caused by the lack of support for test bundle resources in SwiftPM. This can be easily fixed by inferring the test file path from the#file
value. Additionally, this behaviour is cross-platform and doesn't require special handling on Linux.