Attempt to fix the iOS CI build #176
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This does a bunch of things:
CMAKE_SYSTEM_NAME
to iOS does most of the workCMAKE_OSX_SYSROOT
needs to be set toiphonesimulator
(doesn't need to be a path, apparently) to make the right libraries foundxctest
executable that's found byFindXCTest
is working only for native macOS executables, which makes all tests breakAttempted solutions:
xcodebuild test
, and the futile attempts to speed that damn thing up, liketest-without-building
instead oftest
and using-only-test:
, but even then each test run takes 30+ secondsxctest
executable,/Applications/Xcode-12.5.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/xctest
, unfortunately it doesn't work out-of-the box either and relies on a ton of undocumented env vars set "just right"All env vars supplied to it from
xcodebuild
are the following, as can be seen inArgumentsTest
in the CI output, and if all are set it works:Things to do:
xctest
executable to be taken for the simulatorUseCorrade
xcodebuild test
or withxctest
, the user still needs to supply an iPhone version, and whether it's a device or simulator. That's done withCORRADE_TESTSUITE_XCTEST_DESTINATION
now.CORRADE_TARGET_IOS_SIMULATOR
CMake var as it's impossible to detect in CMakeSIMULATOR_UDID
not existing was for the original hackyxctest
run, the change toSIMULATOR_MAINSCREEN_SCALE
is totally random and it now XPASSes certain tests)