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