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 [ -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 json_process="$VALGRIND_CMDLINE $json_process"
15 if [ $VALGRIND -eq 1 ]; then
16 # Check for Valgrind error output. The valgrind option
17 # --error-exitcode is not enough because Valgrind doesn't
18 # think unfreed allocs are errors.
19 if grep -E -q '^==[0-9]+== ' $1; then
20 touch $test_log/valgrind_error
26 valgrind_show_error() {
27 if [ $VALGRIND -eq 1 -a -f $test_log/valgrind_error ]; then
28 echo "valgrind detected an error"