Files
breeze/tests/android_timer_zi_test.sh
waozi 458f4fb5eb Run the test harnesses on the Ziran 0.6 toolchain
Point every harness's default toolchain at build/packages/ziran/build,
drop the removed `zi2zx bundle` form, link the generated C each harness
actually gets (whole generated folders where the test has no stubs, and
Kryon's package-prefixed frame pacing module), and stop listing the
header-only type module in the modal rules test. Twenty-two more test
targets pass from a clean export; plans/2026-11-17-test-harnesses.md
lists the 54 that still fail and why.
2026-11-17 03:12:21 -03:00

30 lines
1.4 KiB
Bash

#!/bin/sh
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
bin=${1:-"$root/build/packages/ziran/build/bin"}
mkdir -p "$root/build"
work=$(mktemp -d "$root/build/android-timer-zi-test.XXXXXX")
trap 'rm -rf "$work"' EXIT HUP INT TERM
"$bin/zi2zir" --check-only --root "$root/src" \
"$root/src/platform/android/android_timer.zi"
"$bin/ziran" bundle --root "$root/tests" \
--module-path "$root/src/platform/android" \
--entry android_timer_policy_behavior:TimerPolicyCheck \
-o "$work/timer.zx" "$root/tests/android_timer_policy_behavior.zi"
test "$("$bin/ziran" run "$work/timer.zx")" = 42
"$bin/zi2c" --no-main --define ANDROID_BUILD --root "$root/src" \
-o "$work/gen" "$root/src/platform/android/android_timer.zi" \
"$root/src/platform/android/android_timer_host.zi" \
"$root/src/platform/android/android_mutex.zi"
"${CC:-cc}" -std=c11 -Wall -Wextra -Werror -Wno-unused-function \
-D_POSIX_C_SOURCE=200809L -DANDROID_BUILD=1 -pthread \
-I"$root/src" -I"$root/build/packages/ziran/include" -I"$work/gen" \
"$root/tests/android_timer_host_test.c" \
"$work/gen/platform/android/android_timer_host.c" \
"$work/gen/platform/android/android_timer.c" \
"$work/gen/platform/android/android_mutex.c" -o "$work/host-test"
env -u DISPLAY -u WAYLAND_DISPLAY "$work/host-test"
echo "Inbe Android timer policy, Zi worker, and native output passed"