#!/usr/bin/env bash # SPDX-License-Identifier: MIT # Rung 5: the frame (6502-rust's Frame and Part) carries the four 65C02 rows # with no NMOS code linked. tests/rows_on_frame.rs drives every row through the # frame's API alone (reset per row, the poll, CLI's delay, one-cycle NOPs, WAI, # STP, a held write cycle, the signals, step()'s count for every opcode of # every row, state); 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 rows_on_frame 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 5: FAILED (the source names the NMOS part)" exit 1 fi for binary in trace sst programs capture; 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 5: FAILED (NMOS code is linked into $binary)" exit 1 fi done echo "rung 5: passed"