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

37 lines
2.0 KiB
Bash

#!/bin/sh
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
compiler=${1:-"${ZIRAN_BIN:-"$root/build/packages/ziran/build/bin/ziran"}"}
launcher=$compiler
ziran_dir=$(cd "$root" && "$launcher" pkg path ziran)
monocypher=$(cd "$root" && "$launcher" pkg path monocypher)
liboqs=${2:-"$root/vendor-builds/linux/x86_64/inbe-liboqs/lib/liboqs.a"}
work=$(mktemp -d /tmp/inbe-delegate-account-test.XXXXXX)
trap 'rm -rf "$work"' EXIT HUP INT TERM
unset DISPLAY WAYLAND_DISPLAY XAUTHORITY DBUS_SESSION_BUS_ADDRESS
export YUE_DESKTOP_RECOVERY=0
"$compiler" build --target=c --define PLATFORM_DESKTOP --root "$root/tests" \
--module-path "$root/src" --module-path "$root/build/packages/kryon/src/ui" \
--module-path "$root/build/packages/css/src" $(sh "$root/scripts/package-paths.sh" "$root/build/packages") \
--module-path "$root/build/packages/kryon/src/backend" \
--module-path "$root/build/packages/game2d/src" --module-path "$root/build/packages/ziran/std" \
--module-path "$root/build/packages/daochi-client" --entry delegate_account_behavior:Check \
-o "$work/generated" "$root/tests/delegate_account_behavior.zi" "$root/tests/sync_test_host.zi" "$root/tests/delegate_account_host.zi"
cat > "$work/generated/main.c" <<'C'
#include "delegate_account_behavior.h"
#include <stdio.h>
int main(void) {
int result = Check();
if (result) fprintf(stderr, "delegate account check failed with code %d\n", result);
return result ? 1 : 0;
}
C
"${CC:-cc}" -std=c11 -O0 -ffunction-sections -fdata-sections \
-I"$ziran_dir/include" -I"$work/generated" -I"$root/vendor-builds/sqlite" \
-I"$root/vendor-builds/linux/x86_64/inbe-liboqs/include" -I"$monocypher/src" \
"$work/generated"/*.c "$root/vendor-builds/sqlite/sqlite3.c" \
"$monocypher/src/monocypher.c" "$monocypher/src/optional/monocypher-ed25519.c" "$liboqs" \
-Wl,--gc-sections -ldl -lpthread -lm -o "$work/test"
APP_DATA_ROOT="$work/data" "$work/test"
printf '%s\n' 'Inbe delegated account ownership, keys, identity, restoration and owner-route denial passed'