-
Notifications
You must be signed in to change notification settings - Fork 811
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
macOS Unit Test settings variant not present in Unit Tests #265
Comments
thx, I had the same issues and your settings fixed them |
Thanks for raising this @thecb4. It seems providing |
As a functional workaround when creating universal frameworks. Here's what I've done. HyperSpaceUnitTests:
type: bundle.unit-test
platformSuffix: -$platform
platform: [macOS, iOS, tvOS, watchOS]
settings:
INFOPLIST_FILE: Tests/Resources/HyperSpace/Core/Info.plist
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]: "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks" my tests are well behaved now and repeatable without manual manipulation |
version: 1.7.0
Creating Unit Test target applies the same Search Paths across all targets. However, MacOS requires a different path to load XCTest Properly.
XcodeGen Preset:
BUNDLE_LOADER: $(TEST_HOST)
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
Running macOS Test Target produces the following Error:
2018-03-10 12:47:39.308512-0500 xctest[68591:1823752] The bundle “ResultUnitTests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle. 2018-03-10 12:47:39.308557-0500 xctest[68591:1823752] (dlopen_preflight(/Users/cavellebenjamin/Development/apps/Result/DerivedData/Result/Build/Products/Debug/ResultUnitTests.xctest/Contents/MacOS/ResultUnitTests): Library not loaded: @rpath/libswiftXCTest.dylib Referenced from: /Users/cavellebenjamin/Development/apps/Result/DerivedData/Result/Build/Products/Debug/ResultUnitTests.xctest/Contents/MacOS/ResultUnitTests Reason: image not found) Program ended with exit code: 82
macOS requires:
BUNDLE_LOADER: $(TEST_HOST)
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"
runs test correctly:
The text was updated successfully, but these errors were encountered: