2009-07-10 02:01:40 +08:00
|
|
|
#!/bin/sh
|
2009-07-28 16:01:52 +08:00
|
|
|
#
|
|
|
|
# Copyright (c) 2009 Petri Lehtinen <petri@digip.org>
|
|
|
|
#
|
|
|
|
# Jansson is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the MIT license. See LICENSE for details.
|
2009-07-10 02:01:40 +08:00
|
|
|
|
2009-07-18 20:59:55 +08:00
|
|
|
TESTFILES="${srcdir}/testdata/valid"
|
2009-07-10 02:01:40 +08:00
|
|
|
|
|
|
|
run_test() {
|
|
|
|
local prog=$1
|
2009-07-27 03:44:11 +08:00
|
|
|
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
|
2009-07-27 03:44:11 +08:00
|
|
|
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
|
2009-07-27 03:44:11 +08:00
|
|
|
cat $prefix.$prog.stdout >&2
|
2009-07-10 02:01:40 +08:00
|
|
|
fi
|
2009-07-27 03:44:11 +08:00
|
|
|
if [ -s $prefix.$prog.stdout ]; then
|
2009-07-10 02:01:40 +08:00
|
|
|
echo "### compare output:" >&2
|
2009-07-27 03:44:11 +08:00
|
|
|
cat $prefix.$prog.cmp-stdout >&2
|
2009-07-10 02:01:40 +08:00
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
. ${srcdir}/run-test
|