run.sh 725 B

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