1 # Copyright (c) 2009 Petri Lehtinen <petri@digip.org>
3 # Jansson is free software; you can redistribute it and/or modify
4 # it under the terms of the MIT license. See LICENSE for details.
6 VALGRIND_CMDLINE="valgrind --leak-check=full --show-reachable=yes --track-origins=yes -q"
11 if [ -n "$VALGRIND" ]; then
12 local runner="$VALGRIND_CMDLINE "
19 $prefix.$prog.stdout \
20 2>$prefix.$prog.stderr
25 >$prefix.$prog.stdout \
26 2>$prefix.$prog.stderr
30 if [ -n "$VALGRIND" ]; then
31 # Check for Valgrind error output. The valgrind option
32 # --error-exitcode is not enough because Valgrind doesn't
33 # think unfreed allocs are errors.
34 if grep -E -q '^==[0-9]+== ' $prefix.$prog.stderr; then
35 echo "### $prefix ($prog) failed:" >&2
36 echo "valgrind detected an error" >&2
37 echo "for details, see test/$prefix.$prog.stderr" >&2
43 for testfile in $TESTFILES; do
44 tmpdir="testlogs/`basename $testfile`"
47 ${srcdir}/split-testfile.py $testfile $tmpdir | while read name; do
48 run_test loadf_dumpf $tmpdir/$name
49 run_test loads_dumps $tmpdir/$name
50 run_test load_file_dump_file $tmpdir/$name