Commit 5f54907963

5f54907963d90ea489d23ddd3a726e22710bb1ec

parent: 6e3b73d93b

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-24 04:34 UTC

Run the unit suite on the floor and current runtimes

The suite's result is not runtime independent. Releasing a main-actor-isolated
object aborts the runner under iOS 18.6 with "pointer being freed was not
allocated" — a Swift runtime bug in MarkerItem::create, fixed by iOS 26.5 — so
a test that constructs and releases a view model passes on one runtime and dies
on the other. The deployment target does not decide it: an iOS 18 floor is
still affected.

Scripts/test.sh takes the same floor/current/both tiers as the accessibility
audit, and its grep surfaces the malloc abort so a crash cannot be read as an
ordinary failure. 129 tests pass on iOS 18.6 and on iOS 27.0.

Layout: unified · split

README.org +12
@@ -44,6 +44,18 @@ xcodebuild -project DomainDig.xcodeproj -scheme DomainDig \
44* tests 44* tests
45deterministic core coverage lives in DomainDigTests: 45deterministic core coverage lives in DomainDigTests:
46 46
47#+begin_src sh
48./Scripts/test.sh # oldest supported + newest
49./Scripts/test.sh current # newest only
50#+end_src
51
52both tiers matter. releasing a main-actor-isolated object aborts the runner
53under ios 18.6 — a swift runtime bug in MarkerItem::create, fixed by 26.5 — so
54a test can pass on one runtime and die on the other. pinning one destination
55hides whichever direction it is pinned away from.
56
57a one-off run against a specific simulator:
58
47#+begin_src sh 59#+begin_src sh
48xcodebuild test -project DomainDig.xcodeproj -scheme DomainDig \ 60xcodebuild test -project DomainDig.xcodeproj -scheme DomainDig \
49 -destination 'platform=iOS Simulator,name=iPhone 16' \ 61 -destination 'platform=iOS Simulator,name=iPhone 16' \
Scripts/test.sh added +87
@@ -0,0 +1,87 @@
1#!/usr/bin/env bash
2#
3# Run the deterministic unit suite against real simulator runtimes.
4#
5# ./Scripts/test.sh # floor + current
6# ./Scripts/test.sh floor # oldest supported runtime only
7# ./Scripts/test.sh current # newest installed runtime only
8#
9# Why both rather than one simulator: the suite's result is not runtime
10# independent. Releasing a main-actor-isolated object aborts the test runner
11# under iOS 18.6 with "pointer being freed was not allocated" — a Swift runtime
12# bug in MarkerItem::create, fixed by iOS 26.5 — so a test that constructs and
13# releases a view model passes on current and dies on floor. Pinning one
14# destination hides whichever direction it is pinned away from.
15#
16# This covers DomainDigTests only. Scripts/audit-a11y.sh covers the
17# accessibility suite, which has its own reason for running both tiers.
18
19set -euo pipefail
20
21cd "$(dirname "$0")/.."
22
23PROJECT="DomainDig.xcodeproj"
24SCHEME="DomainDig"
25TIER="${1:-both}"
26
27# shellcheck source=lib/simulators.sh
28source "$(dirname "$0")/lib/simulators.sh"
29
30case "$TIER" in
31 floor | current | both) ;;
32 *)
33 echo "usage: $0 [floor|current|both]" >&2
34 exit 2
35 ;;
36esac
37
38echo "==> Reading deployment target from $PROJECT"
39read_deployment_target
40echo " deployment target: $DEPLOYMENT_TARGET (rank $FLOOR_RANK)"
41
42run_tier() {
43 local which="$1"
44 local sim udid label
45
46 sim=$(select_sim "$which")
47 if [[ -z "$sim" ]]; then
48 echo "error: no iPhone simulator at or above iOS $DEPLOYMENT_TARGET installed" >&2
49 echo "hint: install one with 'xcodebuild -downloadPlatform iOS'" >&2
50 return 1
51 fi
52
53 udid=$(echo "$sim" | jq -r .udid)
54 label=$(echo "$sim" | jq -r '"\(.name) (iOS \(.os))"')
55
56 echo
57 echo "==> $which: $label"
58
59 if [[ "$which" = "floor" ]] && floor_is_approximate "$sim"; then
60 echo " NOTE: nearest installed runtime is a major version above the $DEPLOYMENT_TARGET"
61 echo " deployment target, so this is not true floor coverage."
62 fi
63
64 set -o pipefail
65 xcodebuild test \
66 -project "$PROJECT" \
67 -scheme "$SCHEME" \
68 -destination "id=$udid" \
69 -only-testing:DomainDigTests 2>&1 \
70 | grep -E 'Executed [0-9]+ test|\*\* TEST (SUCCEEDED|FAILED)|error:|malloc: \*\*\*|^Test Case .* failed'
71}
72
73status=0
74if [[ "$TIER" = "both" ]]; then
75 run_tier floor || status=1
76 run_tier current || status=1
77else
78 run_tier "$TIER" || status=1
79fi
80
81echo
82if [[ "$status" -eq 0 ]]; then
83 echo "==> Done. Green on every tier run."
84else
85 echo "==> At least one tier failed."
86fi
87exit "$status"