jansson/test/test-invalid

28 lines
702 B
Plaintext
Raw Normal View History

2009-07-10 02:01:40 +08:00
#!/bin/sh
#
# 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
TESTFILES="${srcdir}/testdata/invalid ${srcdir}/testdata/invalid-unicode"
2009-07-10 02:01:40 +08:00
run_test() {
local prog=$1
local prefix=$2
run_testprog $prog $prefix
if ! cmp $prefix.out $prefix.$prog.stderr >/dev/null; then
echo >&2
echo "### $prefix ($prog) failed:" >&2
cat $prefix.in >&2
2009-07-10 02:01:40 +08:00
echo "### expected output:" >&2
cat $prefix.out >&2
2009-07-10 02:01:40 +08:00
echo "### actual output:" >&2
cat $prefix.$prog.stderr >&2
2009-07-10 02:01:40 +08:00
exit 1
fi
}
. ${srcdir}/run-test