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.
25 lines
1.3 KiB
Bash
25 lines
1.3 KiB
Bash
#!/bin/sh
|
|
set -eu
|
|
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
bin=${1:-"$root/build/packages/ziran/build/bin"}
|
|
standard=${2:-"$root/build/packages/ziran/std"}
|
|
work="$root/build/radio-test"
|
|
curl=${CURL_LIBRARY:-$(ls /usr/lib/x86_64-linux-gnu/libcurl.so.4 2>/dev/null || echo -lcurl)}
|
|
rm -rf "$work/c"
|
|
mkdir -p "$work/c"
|
|
"$bin/zi2c" --no-main --root "$root/src" --module-path "$standard" \
|
|
-o "$work/c" "$root/src/platform/radio_runtime.zi"
|
|
ffmpeg -hide_banner -loglevel error -y -f lavfi -i 'sine=frequency=440:duration=3:sample_rate=44100' \
|
|
-ac 1 -c:a libmp3lame -b:a 128k "$work/mono.mp3"
|
|
ffmpeg -hide_banner -loglevel error -y -f lavfi -i 'sine=frequency=220:duration=3:sample_rate=48000' \
|
|
-ac 2 -c:a libmp3lame -b:a 128k "$work/stereo.mp3"
|
|
generated_sources=$(find "$work/c" -name '*.c' | sort)
|
|
"${CC:-cc}" -std=c11 -O1 -g -DZIRAN_BOUNDS_CHECK -ffunction-sections -fdata-sections \
|
|
-fsanitize=address,undefined -Wl,--gc-sections \
|
|
-I"$(dirname "$standard")/include" -I"$root/build/packages/raylib/src" \
|
|
-I"$work/c" "$root/tests/radio_native_test.c" \
|
|
$generated_sources \
|
|
"$curl" -lpthread -lm -o "$work/test"
|
|
env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS \
|
|
YUE_DESKTOP_RECOVERY=0 ASAN_OPTIONS=detect_leaks=0 "$work/test" "$work/mono.mp3" "$work/stereo.mp3"
|