File:  [HATARI the Atari ST Emulator] / hatari / tests / cpu / run_test.sh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 9 08:58:39 2019 UTC (7 years, 3 months ago) by root
Branches: hatari, MAIN
CVS tags: hatari02210, hatari02200, HEAD
hatari 2.2.0

#!/bin/sh

if [ $# -lt 1 -o "$1" = "-h" -o "$1" = "--help" ]; then
	echo "Usage: $0 <hatari> <testprg> ..."
	exit 1;
fi

hatari=$1
shift
if [ ! -x "$hatari" ]; then
	echo "First parameter must point to valid hatari executable."
	exit 1;
fi;

testprg=$1
shift
if [ ! -f "$testprg" ]; then
	echo "Second parameter must point to valid test PRG."
	exit 1;
fi;

basedir=$(dirname $0)
testdir=$(mktemp -d)

remove_temp() {
  rm -rf "$testdir"
}
trap remove_temp EXIT

export SDL_VIDEODRIVER=dummy
export SDL_AUDIODRIVER=dummy

HOME="$testdir" $hatari --log-level error --sound off --fast-forward on \
	--tos none --run-vbls 500 $* "$testprg" > "$testdir/out.txt" 2>&1
exitstat=$?
if [ $exitstat -ne 0 ]; then
	echo "Running hatari failed. Status=${exitstat}."
	cat "$testdir/out.txt"
	exit 1
fi

# Now check for failure strings:

if grep -qi fail "$testdir/out.txt"; then
	echo "Test FAILED:"
	cat "$testdir/out.txt"
	exit 1
fi
if grep -qi error "$testdir/out.txt"; then
	echo "Test ERROR:"
	cat "$testdir/out.txt"
	exit 1
fi

echo "Test PASSED."
exit 0

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.