jansson/test/test-valid

30 lines
658 B
Plaintext
Raw Normal View History

2009-07-10 02:01:40 +08:00
#!/bin/sh
TESTFILES="${srcdir}/testdata/valid"
2009-07-10 02:01:40 +08:00
run_test() {
local prog=$1
local prefix=$2
run_testprog $prog $prefix
if ! ${srcdir}/json-compare.py $prefix.in $prefix.$prog.stdout \
>$prefix.$prog.cmp-stdout
2009-07-10 02:01:40 +08:00
then
echo >&2
echo "### $prefix ($prog) failed:" >&2
cat $prefix.in >&2
if [ -f $prefix.$prog.stdout ]; then
2009-07-10 02:01:40 +08:00
echo "### output:" >&2
cat $prefix.$prog.stdout >&2
2009-07-10 02:01:40 +08:00
fi
if [ -s $prefix.$prog.stdout ]; then
2009-07-10 02:01:40 +08:00
echo "### compare output:" >&2
cat $prefix.$prog.cmp-stdout >&2
2009-07-10 02:01:40 +08:00
fi
exit 1
fi
}
. ${srcdir}/run-test