#!/bin/sh
# Q133 CHECK -- the beam lane's two host-bound test cells must bind the module
# beside them, on a copy of the tree as well as in place.
#
# rc 0 = every leg as expected; 1 = a graded fault; 2 = could not grade.
# The work is done by wizard-work/volt/q133_verify.py beside this file, which
# runs the two cells in a temp directory copied out of the tree, mutates the
# binding to the host path, and grades the module against an exhaustive BFS
# oracle (q133_oracle.py).  The graded tree is only ever read.
set -u
REPO="$(cd "$(dirname "$0")/../.." && pwd)" || exit 2
if ! cd "$REPO"; then
    echo "q133: could not grade -- cannot cd to $REPO"
    exit 2
fi
if ! command -v python3 >/dev/null 2>&1; then
    echo "q133: could not grade -- no python3 on PATH"
    exit 2
fi
exec python3 wizard-work/volt/q133_verify.py "$@"
