Files
breeze/tests/main_platform_zi_test.sh
T
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

23 lines
1.1 KiB
Bash

#!/bin/sh
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
bin=${1:-"$root/build/packages/ziran/build/bin"}
raylib=${2:-"$root/vendor-builds/linux/x86_64/raylib/libraylib.a"}
work=$(mktemp -d "$root/build/main-platform-zi.XXXXXX")
trap 'rm -rf "$work"' EXIT HUP INT TERM
"$bin/zi2c" --no-main --define PLATFORM_DESKTOP --root "$root/tests" \
--module-path "$root/src/platform" --module-path "$root/build/packages/kryon/src/backend" \
--module-path "$root/build/packages/ziran/std" \
-o "$work/c" "$root/tests/main_platform_behavior.zi"
"${CC:-cc}" -std=c11 -O2 -DZIRAN_BOUNDS_CHECK \
-ffunction-sections -fdata-sections -Wl,--gc-sections \
-I"$root/build/packages/ziran/include" -iquote "$work/c" \
"$work/c"/*.c "$raylib" ${RAY_LDLIBS:-} -lm -ldl -pthread -latomic -o "$work/test"
cd "$work"
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u GDK_DISPLAY \
./test 2> stderr
test "$(cat stderr)" = "WARNING: IMAGE: retained
INFO: values 42 3.25 inbe.test"
test "$(cat inbe.log)" = '[ERROR] WGL test failure'
echo "Inbe Ziran process setup and logging test passed"