1 # Copyright (c) 2009, 2010 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 [ -z "$VALGRIND" ] && VALGRIND=0
8 VALGRIND_CMDLINE="valgrind --leak-check=full --show-reachable=yes --track-origins=yes -q"
10 if [ $VALGRIND -eq 1 ]; then
11 test_runner="$VALGRIND_CMDLINE"
12 json_process="$VALGRIND_CMDLINE $json_process"
18 if [ $VALGRIND -eq 1 ]; then
19 # Check for Valgrind error output. The valgrind option
20 # --error-exitcode is not enough because Valgrind doesn't
21 # think unfreed allocs are errors.
22 if grep -E -q '^==[0-9]+== ' $1; then
23 touch $test_log/valgrind_error
29 valgrind_show_error() {
30 if [ $VALGRIND -eq 1 -a -f $test_log/valgrind_error ]; then
31 echo "valgrind detected an error"