Track the reviewed Arcade baseline artwork and verify both baseline files are included in Git. Keep its independently reviewed source provenance separate from the metadata dependency pin. Resolve current Kryon widgets through the locked project graph, link the selected compiler runtime and actual native dependencies, and provide asset-free image callbacks for behavior fixtures. Optimize large test state initializers as native builds do. Include recovery in the extracted meditation fixture and keep Unreleased notes within the Lumi limit. Local tests: clean asset-only archive reproduction and candidate repair; apps, node-apps, build-laws, package versions/workflows/manifests/uploads; workout, sun pose/artwork/voice, Telegram SVG, achievements, habit form, habit sessions, Lists, session results, Lumi updates, package release and bundled-artwork tests. All ran through build-queue.
33 lines
1.2 KiB
Bash
33 lines
1.2 KiB
Bash
#!/bin/sh
|
|
set -eu
|
|
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
bin=${1:-"$root/build/packages/ziran/build/bin"}
|
|
source=${2:?practice behavior source required}
|
|
name=$(basename "$source" .zi)
|
|
case "$name" in
|
|
''|*[!a-zA-Z0-9_]*) echo 'Invalid practice test name' >&2; exit 2 ;;
|
|
esac
|
|
source="$root/tests/$name.zi"
|
|
test -f "$source"
|
|
work="$root/build/$name-test"
|
|
rm -rf "$work"
|
|
mkdir -p "$work/c"
|
|
"$bin/zi2zir" --check-only --root "$root/tests" --module-path "$root/src" \
|
|
--module-path "$root/build/packages/ziran/std" "$source"
|
|
"$bin/zi2c" --no-main --root "$root/tests" --module-path "$root/src" \
|
|
--module-path "$root/build/packages/ziran/std" -o "$work/c" \
|
|
"$source"
|
|
cat > "$work/c/main.c" <<C
|
|
#include "$name.h"
|
|
#include <stdio.h>
|
|
int main(void) {
|
|
int result = Answer();
|
|
if (result != 42) fprintf(stderr, "$name check failed: %d\n", result);
|
|
return result == 42 ? 0 : 1;
|
|
}
|
|
C
|
|
"${CC:-cc}" -std=c11 -I"$root/build/packages/ziran/include" -I"$work/c" \
|
|
"$work/c"/*.c "$bin/../libziran.a" -lm -lz -o "$work/test"
|
|
(cd "$root/tests" && env -u DISPLAY -u WAYLAND_DISPLAY -u XAUTHORITY -u DBUS_SESSION_BUS_ADDRESS "$work/test")
|
|
echo "$name: practice behavior and figure passed"
|