Annotation of hatari/tests/serial/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> <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: sertype=$2
        !            15: machine=$3
        !            16: 
        !            17: basedir=$(dirname $0)
        !            18: testdir=$(mktemp -d)
        !            19: 
        !            20: touch "$testdir"/empty.txt
        !            21: 
        !            22: export SDL_VIDEODRIVER=dummy
        !            23: export SDL_AUDIODRIVER=dummy
        !            24: unset TERM
        !            25: 
        !            26: if [ "$sertype" = "mfp" ]; then
        !            27:        serparams="--rs232-in $testdir/empty.txt --rs232-out $testdir/serial-out.txt"
        !            28:        testprog=mfp_ser.tos
        !            29: elif [ "$sertype" = "midi" ]; then
        !            30:        serparams="--midi-in $testdir/empty.txt --midi-out $testdir/serial-out.txt"
        !            31:        testprog=midi_ser.tos
        !            32: elif [ "$sertype" = "scc" ]; then
        !            33:        serparams="--scc-b-out $testdir/serial-out.txt"
        !            34:        testprog=scc_ser.tos
        !            35: else
        !            36:        echo "Unsupported serial type: $sertype"
        !            37:        exit 1
        !            38: fi
        !            39: 
        !            40: HOME="$testdir" $hatari --log-level fatal --sound off --tos none \
        !            41:        --fast-forward on  --run-vbls 500 $serparams --machine "$machine" \
        !            42:        "$basedir"/"$testprog" > "$testdir/out.txt"
        !            43: exitstat=$?
        !            44: if [ $exitstat -ne 0 ]; then
        !            45:        echo "Test FAILED. Hatari exited with status ${exitstat}."
        !            46:        cat "$testdir/out.txt"
        !            47:        rm -rf "$testdir"
        !            48:        exit 1
        !            49: fi
        !            50: 
        !            51: if ! diff -q "$basedir/expected.txt" "$testdir/serial-out.txt"; then
        !            52:        echo "Test FAILED, output differs:"
        !            53:        diff -u "$basedir/expected.txt" "$testdir/serial-out.txt"
        !            54:        rm -rf "$testdir"
        !            55:        exit 1
        !            56: fi
        !            57: 
        !            58: echo "Test PASSED."
        !            59: rm -rf "$testdir"
        !            60: exit 0

unix.superglobalmegacorp.com

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