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.
32 lines
1.1 KiB
Bash
32 lines
1.1 KiB
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
bin=${1:-"$root/build/packages/ziran/build/bin"}
|
|
include=${ZIRAN_INCLUDE:-"$root/build/packages/ziran/include"}
|
|
work=$(mktemp -d)
|
|
trap 'rm -rf "$work"' EXIT HUP INT TERM
|
|
|
|
source=$root/tests/meditation_timing_behavior.zi
|
|
"$bin/zi2zir" --root "$root/tests" --module-path "$root/src" \
|
|
-o "$work/ir" "$source"
|
|
"$bin/zi2zx" --root "$root/tests" --module-path "$root/src" \
|
|
--entry meditation_timing_behavior:Answer \
|
|
-o "$work/source.zx" "$source"
|
|
"$bin/zi2zx" --root "$work/ir" \
|
|
--entry meditation_timing_behavior:Answer \
|
|
-o "$work/saved.zx" "$work/ir/meditation_timing_behavior.zir"
|
|
cmp "$work/source.zx" "$work/saved.zx"
|
|
test "$("$bin/zi2zx" run "$work/source.zx")" = 42
|
|
test "$("$bin/zi2zx" run "$work/saved.zx")" = 42
|
|
|
|
"$bin/zi2c" --no-main --root "$root/tests" --module-path "$root/src" \
|
|
-o "$work/c" "$source"
|
|
cat > "$work/c/main.c" <<'C'
|
|
#include "meditation_timing_behavior.h"
|
|
int main(void) { return Answer() == 42 ? 0 : 1; }
|
|
C
|
|
"${CC:-cc}" -std=c11 -I"$include" -I"$work/c" \
|
|
"$work/c"/*.c -o "$work/test"
|
|
env -u DISPLAY -u WAYLAND_DISPLAY "$work/test"
|