#!/bin/sh # Run the Statum DOM-walk + forms test scenarios. # # Builds the vendored QuickJS interpreter if no `qjs` is on PATH (same # bootstrap as tests/markdown/run.sh), then runs each scenario in a fresh # context. Exits non-zero when any scenario fails. # # Usage: tests/dom/run.sh [scenario] (default: all thirty-six) set -e cd "$(dirname "$0")/../.." ROOT=$(pwd) QJS="$ROOT/tools/qjs/qjs" if ! command -v qjs >/dev/null 2>&1; then echo "== building vendored QuickJS ==" "$ROOT/tools/qjs/build.sh" else QJS=$(command -v qjs) fi SCENARIOS="${1:-1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36}" for n in $SCENARIOS; do echo "== dom scenario $n ==" "$QJS" "$ROOT/tests/dom/scenarios.js" "$n" done echo "OK"