Files
breeze/tests/patterns_rules_zi_test.sh
T
waozi 7fbef85924 Repair clean-checkout builds and the package-release harness
Install ffmpeg wherever the app build checks the guide narration clips:
the check decodes every clip, and only the Test jobs had ffmpeg, so web,
Linux, Windows, Android, Snap and F-Droid builds reported all 320 clips
as stale. Link the package-release harness and the sync server against
the pinned toolchain instead of the removed build/ziran-toolchain, use
the current zi2zx command form, resolve the media compression test
through package exports, and stage Tai Chi preview voices only for the
app's own locales.
2026-11-17 01:44:55 -03:00

27 lines
966 B
Bash

#!/bin/sh
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
bin=${1:-"$root/build/ziran-toolchain/bin"}
work=$(mktemp -d "$root/build/patterns-rules-test.XXXXXX")
trap 'rm -rf "$work"' EXIT HUP INT TERM
source=$root/tests/patterns_rules_behavior.zi
"$bin/zi2zir" --check-only --root "$root/tests" \
--module-path "$root/src" "$source"
"$bin/zi2zx" --root "$root/tests" \
--module-path "$root/src" \
--entry patterns_rules_behavior:Answer \
-o "$work/patterns.zx" "$source"
test "$("$bin/zi2zx" run "$work/patterns.zx")" = 42
"$bin/zi2c" --no-main --root "$root/tests" \
--module-path "$root/src" -o "$work/c" "$source"
cat > "$work/c/main.c" <<'C'
#include "patterns_rules_behavior.h"
int main(void) { return Answer() == 42 ? 0 : 1; }
C
"${CC:-cc}" -std=c11 -I"$root/build/packages/ziran/include" \
-I"$work/c" "$work/c"/*.c -o "$work/test"
env -u DISPLAY -u WAYLAND_DISPLAY "$work/test"
echo "Patterns preset Ziran test passed"