Files
breeze/tests/locale_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

47 lines
2.5 KiB
Bash

#!/bin/sh
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
bin=${1:-"$root/build/packages/ziran/build/bin"}
kryon=${KRYON_DIR:-"$root/build/packages/kryon"}
toolchain=${ZIRAN_DIR:-"$root/build/packages/ziran"}
work=$root/build/locale-zi-test
mkdir -p "$work/c" "$work/dropdown-c"
"$bin/zi2zir" --check-only --root "$root/src" \
--module-path "$kryon/src/ui" \
--module-path "$toolchain/std" --module-path "$root/build/packages/daochi-client" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") --module-path "$kryon/src/backend" "$root/src/app/locale.zi"
"$bin/zi2zir" --check-only --root "$root/src" \
--module-path "$kryon/src/ui" \
--module-path "$toolchain/std" --module-path "$root/build/packages/daochi-client" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") --module-path "$kryon/src/backend" \
"$root/src/app/locale_dropdown.zi"
"$bin/zi2c" --no-main --root "$root/src" \
--module-path "$kryon/src/ui" \
--module-path "$toolchain/std" --module-path "$root/build/packages/daochi-client" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") --module-path "$kryon/src/backend" \
-o "$work/dropdown-c" "$root/src/app/locale_dropdown.zi"
"${CC:-cc}" -std=c11 -I"$toolchain/include" \
-I"$work/dropdown-c" -c "$work/dropdown-c/app/locale_dropdown.c" \
-o "$work/locale_dropdown.o"
"$bin/zi2c" --no-main --root "$root/tests" \
--module-path "$root/src" \
--module-path "$kryon/src/ui" \
--module-path "$toolchain/std" --module-path "$root/build/packages/daochi-client" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") --module-path "$kryon/src/backend" \
-o "$work/c" "$root/tests/locale_link_behavior.zi"
mkdir -p "$work/c/app"
cp "$work/c/assets.h" "$work/c/app/assets.h"
python3 "$root/scripts/embed-app-assets.py" "$work/assets.c" "$root"/locales/*.txt
cat > "$work/c/main.c" <<'C'
#include "locale_link_behavior.h"
int main(void) { return Answer() == 42 ? 0 : 1; }
C
"${CC:-cc}" -std=c11 -DZIRAN_BOUNDS_CHECK -ffunction-sections \
-fdata-sections -Wl,--gc-sections -I"$toolchain/include" \
-I"$work/c" -I"$root/src/app" \
"$work/assets.c" \
"$work/c"/*.c -o "$work/test"
env -u DISPLAY -u WAYLAND_DISPLAY LANGUAGE=es_AR.UTF-8 "$work/test"
env -u DISPLAY -u WAYLAND_DISPLAY ZIRAN_BIN="$bin/ziran" \
sh "$root/tests/locale_parser_portability_test.sh"
env -u DISPLAY -u WAYLAND_DISPLAY ZIRAN_BIN="$bin/ziran" \
sh "$root/tests/locale_policy_portability_test.sh"
echo "Inbe locale Ziran/native link test passed"