1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-05 19:31:04 +00:00

Make Luanti buildable for iOS (iPhoneSimulator) with ANGLE and basic CI.

This commit is contained in:
SFENCE 2024-11-18 13:21:02 +01:00
parent 5672b93007
commit 803870e0d2
28 changed files with 568 additions and 36 deletions

36
util/ci/run_ios.sh Executable file
View file

@ -0,0 +1,36 @@
#!/bin/sh
DEVICE_NAME=$1
TIMEOUT=$2
xcrun simctl boot "$DEVICE_NAME"
xcrun simctl install booted build/build/Release-iphonesimulator/luanti.app
# Run the iOS app in the background
xcrun simctl launch --console booted org.luanti.luanti --run-unittests 2> log.txt &
APP_PID=$!
# Initialize variables
CHECK_INTERVAL=15
ELAPSED_TIME=0
FOUND_RESULT=false
# Monitor the log file
while [ $ELAPSED_TIME -lt $TIMEOUT ]; do
if grep -q "Unit Test Results:" log.txt; then
FOUND_RESULT=true
break
fi
sleep $CHECK_INTERVAL
ELAPSED_TIME=$((ELAPSED_TIME + CHECK_INTERVAL))
done
# Terminate the app
if $FOUND_RESULT; then
echo "Unit test results found. Terminating the app."
else
echo "Timeout reached. Terminating the app."
fi
xcrun simctl terminate booted org.luanti.luanti
xcrun simctl shutdown booted