#!/usr/bin/env bash # SPDX-License-Identifier: MIT # Rungs 2 and 3 (the reference's): gilyon's cputest-full and -basic, and krom's # 23 CPU tests, natively in the harness (src/bin/roms.rs, the reference's # tests/test_cputest.py and tests/test_krom.py): every ROM passes, and every # line (stop reason, cycles, PC, the printed verdict, the PASS rows) equals the # reference's (conformance/expected/roms.txt, from scripts/reference_roms.py). set -euo pipefail source "$(dirname "$0")/env.sh" nice -n 19 cargo build --release -q --manifest-path "$ROOT/Cargo.toml" mkdir -p "$ROOT/external" out="$ROOT/external/rung2-roms.txt" status=0 nice -n 19 "$ROOT/target/release/roms" "$CPUTEST" "$KROM" > "$out" || status=$? cat "$out" if [ "$status" != 0 ]; then echo "rungs 2-3: FAILED (a ROM did not pass)" exit 1 fi if diff "$out" "$ROOT/conformance/expected/roms.txt"; then echo "rung 2: passed, cputest-full and -basic print Success at the reference's last test and cycle" echo "rung 3: passed, krom's 23 CPU tests: every PASS row, every line the reference's" else echo "rungs 2-3: FAILED (the lines differ from the reference's, above)" exit 1 fi