oficina / docs Public

Clone
git clone https://amadan.net/oficina/docs

Plain git — no account needed to clone.

Download

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]
9set -eu
10cd "$(dirname "$0")/.."
11name=${1:-iPhone 18 Pro}
12os=${2:-27.0}
13if [ "${OFICINA_SKIP_PREPARE:-0}" != 1 ]; then scripts/build-crdt.sh; fi
14xcodegen generate --spec ios/project.yml
15mkdir -p apple/.build
16log=apple/.build/test-iphone.log
17status=0
18xcodebuild 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=$?
22grep -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"
24exit $status
25