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