2009-07-10 02:01:40 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2009-07-18 20:59:55 +08:00
|
|
|
TESTFILES="${srcdir}/testdata/invalid ${srcdir}/testdata/invalid-unicode"
|
2009-07-10 02:01:40 +08:00
|
|
|
TMPDIR="tmp"
|
|
|
|
|
|
|
|
run_test() {
|
|
|
|
local prog=$1
|
|
|
|
local input=$2
|
|
|
|
local output=$3
|
|
|
|
run_testprog $prog $TMPDIR/$input
|
|
|
|
if ! cmp $TMPDIR/$output $TMPDIR/error >/dev/null; then
|
|
|
|
echo "### $input ($prog) failed:" >&2
|
|
|
|
cat $TMPDIR/$input >&2
|
|
|
|
echo "### expected output:" >&2
|
|
|
|
cat $TMPDIR/$output >&2
|
|
|
|
echo "### actual output:" >&2
|
|
|
|
cat $TMPDIR/error >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
. ${srcdir}/run-test
|