#!/usr/bin/env bash # SPDX-License-Identifier: MIT # Rung 7 (this crate's): the frame (6502-rust's Frame and Part) carries the # 65C816 with no NMOS code linked. tests/interrupts.rs (the reference's # tests/test_interrupts.py, transcribed) drives reset, IRQ, NMI, ABORT, WAI and # STP through the frame's API; then every built binary is checked: no Mos6502 # symbol, and every symbol from sixfiveohtwo is in its frame module. set -euo pipefail ROOT=$(cd "$(dirname "$0")/.." && pwd) nice -n 19 cargo test --release -q --manifest-path "$ROOT/Cargo.toml" --test interrupts nice -n 19 cargo build --release -q --manifest-path "$ROOT/Cargo.toml" if grep -rn "Mos6502\|sixfiveohtwo::core\|sixfiveohtwo::Bus" "$ROOT/src" "$ROOT/tests" | grep -v "^[^:]*:[0-9]*: *//"; then echo "rung 7: FAILED (the source names the NMOS part)" exit 1 fi for binary in trace sst roms mame_replay; do symbols=$(nm -C "$ROOT/target/release/$binary") nmos=$(grep -c "Mos6502" <<< "$symbols" || true) outside=$(grep "sixfiveohtwo::" <<< "$symbols" | grep -vc "sixfiveohtwo::frame::" || true) frame=$(grep -c "sixfiveohtwo::frame::" <<< "$symbols" || true) echo "$binary: $nmos Mos6502 symbols, $frame from sixfiveohtwo::frame, $outside from elsewhere in sixfiveohtwo" if [ "$nmos" != 0 ] || [ "$outside" != 0 ]; then echo "rung 7: FAILED (NMOS code is linked into $binary)" exit 1 fi done echo "rung 7: passed"