|
|
1.1 root 1: #!/bin/sh
2:
3: if [ $# -lt 1 -o "$1" = "-h" -o "$1" = "--help" ]; then
4: echo "Usage: $0 <hatari> <testprg> ..."
5: exit 1;
6: fi
7:
8: hatari=$1
9: shift
10: if [ ! -x "$hatari" ]; then
11: echo "First parameter must point to valid hatari executable."
12: exit 1;
13: fi;
14:
15: testprg=$1
16: shift
17: if [ ! -f "$testprg" ]; then
18: echo "Second parameter must point to valid test PRG."
19: exit 1;
20: fi;
21:
22: basedir=$(dirname $0)
23: testdir=$(mktemp -d)
24:
25: remove_temp() {
26: rm -rf "$testdir"
27: }
28: trap remove_temp EXIT
29:
30: export SDL_VIDEODRIVER=dummy
31: export SDL_AUDIODRIVER=dummy
32:
33: HOME="$testdir" $hatari --log-level error --sound off --fast-forward on \
34: --tos none --run-vbls 500 $* "$testprg" > "$testdir/out.txt" 2>&1
35: exitstat=$?
36: if [ $exitstat -ne 0 ]; then
37: echo "Running hatari failed. Status=${exitstat}."
38: cat "$testdir/out.txt"
39: exit 1
40: fi
41:
42: # Now check for failure strings:
43:
44: if grep -qi fail "$testdir/out.txt"; then
45: echo "Test FAILED:"
46: cat "$testdir/out.txt"
47: exit 1
48: fi
49: if grep -qi error "$testdir/out.txt"; then
50: echo "Test ERROR:"
51: cat "$testdir/out.txt"
52: exit 1
53: fi
54:
55: echo "Test PASSED."
56: exit 0
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.