#!/usr/bin/env bash # SPDX-License-Identifier: MIT # Rung 1: every test in ym2612-python's tests/ (contract, measured, manuals, community, # provisional), transcribed to tests/*.rs. set -euo pipefail ROOT=$(cd "$(dirname "$0")/.." && pwd) cd "$ROOT" [ -d "$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin" ] && export PATH="$HOME/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin:$PATH" total=0 for name in contract measured manuals community provisional; do out=$(nice cargo test --release -q --test "$name" 2>&1) || { echo "$out"; echo "rung 1: FAIL ($name)"; exit 1; } passed=$(echo "$out" | grep -oE '[0-9]+ passed' | grep -oE '[0-9]+') echo "tests/$name.rs: $passed passed" total=$((total + passed)) done echo "rung 1: PASS ($total test functions)"