Download this file
| 1 | #!/bin/sh |
| 2 | # The iPhone half of tests that need UIKit's text view (DocsPhoneTests in |
| 3 | # ios/project.yml), in the simulator. Not in .amadan/ci.d: the hub runner |
| 4 | # has no simulator. An editor that loops holds the main thread, so it can |
| 5 | # fail no assertion: the time allowance fails it in a minute instead (and |
| 6 | # xcodebuild retries a hung test, so each one fails that way). |
| 7 | # |
| 8 | # native/scripts/test-iphone.sh [simulator name] [runtime] |
| 9 | set -eu |
| 10 | cd "$(dirname "$0")/.." |
| 11 | name=${1:-iPhone 18 Pro} |
| 12 | os=${2:-27.0} |
| 13 | if [ "${OFICINA_SKIP_PREPARE:-0}" != 1 ]; then scripts/build-crdt.sh; fi |
| 14 | xcodegen generate --spec ios/project.yml |
| 15 | mkdir -p apple/.build |
| 16 | log=apple/.build/test-iphone.log |
| 17 | status=0 |
| 18 | xcodebuild test -project ios/DocsPhone.xcodeproj -scheme DocsPhoneTests \ |
| 19 | -destination "platform=iOS Simulator,name=$name,OS=$os" -derivedDataPath apple/.build/xcode \ |
| 20 | -test-timeouts-enabled YES -default-test-execution-time-allowance 60 -maximum-test-execution-time-allowance 60 \ |
| 21 | CODE_SIGNING_ALLOWED=NO >"$log" 2>&1 || status=$? |
| 22 | grep -E 'error:|Test Case .*(passed|failed)|Executed [0-9]+ test|\*\* (TEST|BUILD) ' "$log" || true |
| 23 | [ $status -eq 0 ] || echo "failed (status $status); full log: $log" |
| 24 | exit $status |
| 25 | |