|
|
1.1 ! root 1: #!/bin/sh ! 2: ! 3: if [ $# -ne 3 -o "$1" = "-h" -o "$1" = "--help" ]; then ! 4: echo "Usage: $0 <hatari> b|w <machine>" ! 5: exit 1; ! 6: fi ! 7: ! 8: hatari=$1 ! 9: if [ ! -x "$hatari" ]; then ! 10: echo "First parameter must point to valid hatari executable." ! 11: exit 1; ! 12: fi; ! 13: ! 14: width=$2 ! 15: machine=$3 ! 16: basedir=$(dirname $0) ! 17: testdir=$(mktemp -d) ! 18: ! 19: case "$machine" in ! 20: st) reffile="st_$width.txt" ;; ! 21: megast) reffile="mst4_$width.txt" ;; ! 22: ste) reffile="ste_$width.txt" ;; ! 23: megaste) reffile="mste4_$width.txt" ;; ! 24: tt) reffile="tt_$width.txt" ;; ! 25: falcon) reffile="fal_n_$width.txt" ;; ! 26: *) echo "Unsupported machine type: $machine"; exit 1;; ! 27: esac ! 28: ! 29: export SDL_VIDEODRIVER=dummy ! 30: export SDL_AUDIODRIVER=dummy ! 31: ! 32: cp "$basedir/buserr_$width.prg" "$testdir" ! 33: HOME="$testdir" $hatari --log-level fatal --fast-forward on --machine $machine \ ! 34: --sound off --run-vbls 500 --tos none "$testdir/buserr_$width.prg" \ ! 35: 2> $testdir/stderr.txt > $testdir/stdout.txt ! 36: exitstat=$? ! 37: if [ $exitstat -ne 0 ]; then ! 38: echo "Running hatari failed. Status=${exitstat}, output in ${testdir}" ! 39: exit 1 ! 40: fi ! 41: ! 42: grep -v '^(' "$basedir/results/$reffile" > "$testdir/expected.txt" ! 43: ! 44: if [ "$width" = "b" ]; then ! 45: tester_output="$testdir/BUSERR_B.TXT" ! 46: else ! 47: tester_output="$testdir/BUSERR_W.TXT" ! 48: fi ! 49: ! 50: if ! diff -q "$testdir/expected.txt" "$tester_output"; then ! 51: echo "Test FAILED, output differs:" ! 52: diff -u "$testdir/expected.txt" "$tester_output" ! 53: rm -rf "$testdir" ! 54: exit 1 ! 55: fi ! 56: ! 57: echo "Test PASSED." ! 58: rm -rf "$testdir" ! 59: exit 0
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.