Annotation of hatari/tests/xbios/run_test.sh, revision 1.1

1.1     ! root        1: #!/bin/sh
        !             2: 
        !             3: if [ $# -lt 1 -o "$1" = "-h" -o "$1" = "--help" ]; then
        !             4:        echo "Usage: $0 <hatari> ..."
        !             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: basedir=$(dirname $0)
        !            16: testdir=$(mktemp -d)
        !            17: 
        !            18: remove_temp() {
        !            19:   rm -rf "$testdir"
        !            20: }
        !            21: trap remove_temp EXIT
        !            22: 
        !            23: export SDL_VIDEODRIVER=dummy
        !            24: export SDL_AUDIODRIVER=dummy
        !            25: 
        !            26: HOME="$testdir" $hatari --log-level fatal --sound off --cpuclock 32 --tos none \
        !            27:        --run-vbls 500 --bios-intercept on $* "$basedir/xbiostst.prg" \
        !            28:        2> "$testdir/out.txt" << EOF
        !            29: c
        !            30: c
        !            31: EOF
        !            32: exitstat=$?
        !            33: if [ $exitstat -ne 0 ]; then
        !            34:        echo "Running hatari failed. Status=${exitstat}."
        !            35:        cat "$testdir/out.txt"
        !            36:        exit 1
        !            37: fi
        !            38: 
        !            39: # Now check for expected strings:
        !            40: 
        !            41: if ! grep -q "%101010.*#42.*2a" "$testdir/out.txt"; then
        !            42:        echo "Test FAILED, missing '#42':"
        !            43:        cat "$testdir/out.txt"
        !            44:        exit 1
        !            45: fi
        !            46: 
        !            47: if ! grep -q "This is a Dbmsg test for a string with fixed size." \
        !            48:    "$testdir/out.txt"; then
        !            49:        echo "Test FAILED, missing Dbmsg string with fixed size:"
        !            50:        cat "$testdir/out.txt"
        !            51:        exit 1
        !            52: fi
        !            53: 
        !            54: if ! grep -q "This is a Dbmsg test for a NUL-terminated string." \
        !            55:    "$testdir/out.txt"; then
        !            56:        echo "Test FAILED, missing NUL-terminated Dbmsg string:"
        !            57:        cat "$testdir/out.txt"
        !            58:        exit 1
        !            59: fi
        !            60: 
        !            61: if ! grep -q "0x1234.*0xdeadc0de" "$testdir/out.txt"; then
        !            62:        echo "Test FAILED, missing Dbmsg code 0x1234:"
        !            63:        cat "$testdir/out.txt"
        !            64:        exit 1
        !            65: fi
        !            66: 
        !            67: echo "Test PASSED."
        !            68: exit 0

unix.superglobalmegacorp.com

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