run.sh 690 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. # Run the Statum module-split 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/split/run.sh [scenario] (default: all seven)
  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}"
  20. for n in $SCENARIOS; do
  21. echo "== split scenario $n =="
  22. "$QJS" "$ROOT/tests/split/scenarios.js" "$n"
  23. done
  24. echo "OK"