#!/bin/bash # SPDX-License-Identifier: MIT # The gate (docs/status.md): every rung in order; stops at the first that fails. # # scripts/ladder.sh rungs 0-4 # FAULTS=1 scripts/ladder.sh and rung 5, the seeded faults (after the lockstep's cache) # # Found through the environment, never a machine path here: SEGA32X_BIOS_DIR (the user's # boot ROMs), NO_INTRO_DIR (the 32X and Mega Drive sets), TEST_ROMS, EXTRA_ROMS, # TITAN_DEMOS (megadrive-rust's cases), SEGA32X_PY (the reference's interpreter). set -eu ROOT=$(cd "$(dirname "$0")/.." && pwd) cd "$ROOT" : "${SEGA32X_BIOS_DIR:?the user\'s 32X boot ROMs}" "${NO_INTRO_DIR:?the No-Intro sets}" export PYPY_GC_NURSERY=1M echo "== rung 0: the dependencies at their revisions, the build, cargo test (rung 2's unit vectors)" scripts/external.sh --check (cd external/megadrive-rust && nice cargo build --release --offline --quiet) (cd external/megadrive-rust-base && nice cargo build --release --offline --quiet) nice cargo build --release --offline --quiet nice cargo test --release --offline --quiet 2>&1 | grep -E "test result|FAILED|panicked" || true nice cargo test --release --offline --quiet > /dev/null echo "== rung 1: ADEN = 0, megadrive-rust's cases through a passive 32X" python3 scripts/passive.py --jobs "${JOBS:-6}" | tail -1 echo "== rung 3: the whole-machine lockstep against sega32x-python (cached by its source tree)" python3 scripts/lockstep.py --jobs "${PY_JOBS:-6}" | tail -1 echo "== rung 4: save states" python3 scripts/state_rung.py --jobs "${JOBS:-6}" | tail -1 if [ -n "${FAULTS:-}" ]; then echo "== rung 5: seeded faults" python3 scripts/seeded_faults.py --jobs "${FAULT_JOBS:-3}" | tail -1 fi echo "ladder passed"