From 1a0af8a98894175d53928bd4e1e40c90fb773eea Mon Sep 17 00:00:00 2001 From: zinc Date: Wed, 14 Oct 2026 19:49:46 +0330 Subject: jit_x64_test: link tests, src and examples into the scratch directory so embed and include programs compile; list the programs whose compile error is expected --- tests/drivers/jit_x64_test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/drivers/jit_x64_test.sh b/tests/drivers/jit_x64_test.sh index 4038d21..ea6e11d 100644 --- a/tests/drivers/jit_x64_test.sh +++ b/tests/drivers/jit_x64_test.sh @@ -19,6 +19,10 @@ tmp=$(mktemp -d) trap 'rm -rf "$tmp"' EXIT # programs run in a scratch directory, so files they create (bareio writes `note`) stay out of the tree mkdir "$tmp/cwd" +# embed and include name paths from the root, so the scratch directory links to them +for d in tests src examples; do ln -s "$root/$d" "$tmp/cwd/$d"; done +# programs whose compile error is the point (tests/test.sh checks the message), or zc0 only +expect_error=" decl_undefined manyerrors undefined_call zc0typed " pass=0 fail=0 total=0 for f in tests/programs/*.zc examples/*.zc examples/learn/*.zc; do [ -n "$filter" ] && [[ "$f" != *$filter* ]] && continue @@ -26,7 +30,7 @@ for f in tests/programs/*.zc examples/*.zc examples/learn/*.zc; do (cd "$tmp/cwd" && timeout "$limit" "$ref" < "$root/$f" > "$tmp/ref.out" 2> "$tmp/ref.err"); rr=$? (cd "$tmp/cwd" && timeout "$limit" "$jit" < "$root/$f" > "$tmp/jit.out" 2> "$tmp/jit.err"); rj=$? ce= - grep -qE '^zc: [0-9]+ errors?$' "$tmp/ref.out" "$tmp/jit.out" "$tmp/ref.err" "$tmp/jit.err" && ce=" compile error" + grep -qE '^zc: [0-9]+ errors?$' "$tmp/ref.out" "$tmp/jit.out" "$tmp/ref.err" "$tmp/jit.err" && [[ "$expect_error" != *" $(basename "$f" .zc) "* ]] && ce=" compile error" if [ -z "$ce" ] && [ "$rr" = "$rj" ] && cmp -s "$tmp/ref.out" "$tmp/jit.out"; then pass=$((pass + 1)) else -- cgit v1.2.3