#!/usr/bin/env bash # SPDX-License-Identifier: MIT # Rung 1 (the reference's rung 1): SingleStepTests 65816, all 512 files, judged # natively with the reference's readings (tests/single_step.py: SH = $01, XH = # YH = 0, the C1, C2 and C9 masks, C4's cases excluded and counted): 0 fail, # and the total line equal to the reference's (conformance/expected/sst.txt). # LIMIT=N runs the first N cases of each file and checks only that none fails. 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/rung1-sst.txt" status=0 nice -n 19 "$ROOT/target/release/sst" "$SST_65816" ${LIMIT:+--limit "$LIMIT"} --jobs "${JOBS:-4}" | tee "$out" || status=$? if [ "$status" != 0 ]; then echo "rung 1: FAILED (a case failed)" exit 1 fi if [ -z "${LIMIT:-}" ]; then if diff <(tail -1 "$out") "$ROOT/conformance/expected/sst.txt"; then echo "rung 1: passed, every count equal to the reference's" else echo "rung 1: FAILED (the counts differ from the reference's, above)" exit 1 fi else echo "rung 1: passed on the first $LIMIT cases of each file (counts not compared)" fi