test/.gitignore: Add testprogs/test_simple
[jansson.git] / test / test-invalid
1 #!/bin/sh
2 #
3 # Copyright (c) 2009 Petri Lehtinen <petri@digip.org>
4 #
5 # Jansson is free software; you can redistribute it and/or modify
6 # it under the terms of the MIT license. See LICENSE for details.
7
8 TESTFILES="${srcdir}/testdata/invalid ${srcdir}/testdata/invalid-unicode"
9
10 run_test() {
11     local prog=$1
12     local prefix=$2
13
14     run_testprog $prog $prefix
15     if ! cmp $prefix.out $prefix.$prog.stderr >/dev/null; then
16         echo >&2
17         echo "### $prefix ($prog) failed:" >&2
18         cat $prefix.in >&2
19         echo "### expected output:" >&2
20         cat $prefix.out >&2
21         echo "### actual output:" >&2
22         cat $prefix.$prog.stderr >&2
23         exit 1
24     fi
25 }
26
27 . ${srcdir}/run-test