1#!/bin/sh
2
3TEST_FILENAME=`echo "$0" | sed 's|.sh||'`
4./test_decode $TEST_FILENAME
5
6ret=$?
7
8# pretty-print a diff showing what happened, and leave the dumped
9# around for possibly moving over the ref.
10if test $ret = 1; then
11    REF_FILENAME="$TEST_FILENAME-ref.txt"
12    NEW_FILENAME="$TEST_FILENAME-new.txt"
13    ./test_decode $TEST_FILENAME -dump > $NEW_FILENAME
14    if test $? = 0; then
15	echo "Differences:"
16	diff -u $REF_FILENAME $NEW_FILENAME
17    fi
18fi
19
20exit $ret
21