#!/usr/bin/env bash # SPDX-License-Identifier: MIT # Rung 3: Dormann's 65C02 extended-opcodes test (the image built for each row), # his NMOS functional test and Clark's decimal test (ERROR pre-filled with $A5), # natively on every row. Passes when every run reaches its success and every # line (trap address, instructions, cycles) equals the reference's rungs 2 and # 3 at e49aceb, unchanged since 9ca4a2f (conformance/expected/programs.txt). The images are read in # place ($DORMANN_BUILT, $DORMANN_FUNCTIONAL). 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/rung3-programs.txt" status=0 nice -n 19 "$ROOT/target/release/programs" "$DORMANN_BUILT" "$DORMANN_FUNCTIONAL" | tee "$out" || status=$? if [ "$status" != 0 ]; then echo "rung 3: FAILED (a program did not reach its success)" exit 1 fi if diff "$out" "$ROOT/conformance/expected/programs.txt"; then echo "rung 3: passed, 12 of 12 runs succeed with the reference's counts" else echo "rung 3: FAILED (the counts differ from the reference's, above)" exit 1 fi