Files
ziran/tests/std_unicode.sh
T
waozi cb0a762fd4 Migrate to one ZX format and delete the old route
zi2zx bundle and ziran run always write and run revision-28 executable
ZX. The semantic bundle reader and writer, the portable VM, the
TinyCC-compiled and linked native bundles with the vendored TinyCC,
bundle libraries, the VM profile, --vm, BundleInstantiatePortable,
libziran-vm.a and the ZIR-based Wasm lowering with zi2wasm are removed;
the Wasm tier, the embedding API and every tool run revision 28. Tests
of the removed VM internals and libraries are removed, and the rest run
on revision 28. Engine problems read as the diagnostics users rely on.
2026-11-14 14:03:01 -03:00

38 lines
1.6 KiB
Bash

#!/bin/sh
# check-cost: 265
set -eu
ziran=$1
unset DISPLAY WAYLAND_DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS
repo=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
mkdir -p "$repo/build/tests"
work=$(mktemp -d "$repo/build/tests/unicode.XXXXXX")
trap 'rm -rf "$work"' EXIT HUP INT TERM
export TMPDIR="$work"
for fixture in std_unicode unicode_conformance; do
"$ziran" check --root tests/spec --module-path std "tests/spec/$fixture.zi"
"$ziran" ir --root tests/spec --module-path std -o "$work/$fixture/ir" "tests/spec/$fixture.zi"
for form in source saved; do
if test "$form" = source; then
input="$repo/tests/spec/$fixture.zi"
set -- --root tests/spec --module-path std
else
input="$work/$fixture/ir/$fixture.zir"
set -- --root "$work/$fixture/ir" --module-path "$work/$fixture/ir"
fi
"$ziran" bundle "$@" --entry "$fixture:NativeMain" -o "$work/$fixture-$form.zx" "$input"
test "$("$ziran" run "$work/$fixture-$form.zx")" = 0
for target in c go; do
output="$work/$fixture/$form-$target"
if test "$target" = go; then
"$ziran" build "$@" --target=go --pkg main --exe --entry "$fixture:NativeMain" -o "$output" "$input"
GO111MODULE=off go run "$output"/*.go
else
"$ziran" build "$@" --target=c --exe --entry "$fixture:NativeMain" -o "$output" "$input"
"$output/$fixture"
fi
done
done
cmp "$work/$fixture-source.zx" "$work/$fixture-saved.zx"
done
echo 'Unicode: UCD assertions plus case/context/titlecase, word/space/decimal/printability, filtering, splitting, malformed UTF-8 and ownership passed on C/Go/VM from source and saved IR'