Gate‑C(Core): normalize exit code for JSON file/pipe (rc mirrors return); add quick smokes (file/pipe parity).
This commit is contained in:
29
tools/smokes/v2/profiles/quick/core/gate_c_parity_file_vm.sh
Normal file
29
tools/smokes/v2/profiles/quick/core/gate_c_parity_file_vm.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# gate_c_parity_file_vm.sh — Gate‑C (file) exit-code mirrors return (quick)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
ROOT="$(cd "$SCRIPT_DIR/../../../../../.." && pwd)"
|
||||
source "$ROOT/tools/smokes/v2/lib/test_runner.sh"
|
||||
require_env || exit 2
|
||||
|
||||
json_path="/tmp/ny_gatec_parity_$$.json"
|
||||
cat >"$json_path" <<'JSON'
|
||||
{"version":0,"kind":"Program","body":[{"type":"Return","expr":{"type":"Int","value":42}}]}
|
||||
JSON
|
||||
|
||||
set +e
|
||||
"$ROOT/target/release/nyash" --json-file "$json_path" >/dev/null 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
rm -f "$json_path"
|
||||
|
||||
if [ $rc -eq 42 ]; then
|
||||
echo "[PASS] gate_c_parity_file_vm"
|
||||
exit 0
|
||||
else
|
||||
echo "[FAIL] gate_c_parity_file_vm: expected rc=42 got $rc" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
24
tools/smokes/v2/profiles/quick/core/gate_c_parity_pipe_vm.sh
Normal file
24
tools/smokes/v2/profiles/quick/core/gate_c_parity_pipe_vm.sh
Normal file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# gate_c_parity_pipe_vm.sh — Gate‑C (stdin pipe) exit-code mirrors return (quick)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
ROOT="$(cd "$SCRIPT_DIR/../../../../../.." && pwd)"
|
||||
source "$ROOT/tools/smokes/v2/lib/test_runner.sh"
|
||||
require_env || exit 2
|
||||
|
||||
payload='{"version":0,"kind":"Program","body":[{"type":"Return","expr":{"type":"Int","value":9}}]}'
|
||||
set +e
|
||||
echo "$payload" | "$ROOT/target/release/nyash" --ny-parser-pipe >/dev/null 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
|
||||
if [ $rc -eq 9 ]; then
|
||||
echo "[PASS] gate_c_parity_pipe_vm"
|
||||
exit 0
|
||||
else
|
||||
echo "[FAIL] gate_c_parity_pipe_vm: expected rc=9 got $rc" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user