]>
Commit | Line | Data |
---|---|---|
74971473 JG |
1 | # |
2 | # Common function definition for PCEPlib valgrind tests | |
3 | # | |
4 | ||
5 | function valgrind_test() | |
6 | { | |
7 | local test_suite=$1 | |
8 | [[ -z ${test_suite} ]] && { echo "${FUNCNAME}(): test_suite not specified."; exit 1; } | |
9 | [[ ! -x "${test_suite}" ]] && { echo "${test_suite} is not an executable file."; exit 1; } | |
10 | ||
11 | G_SLICE=always-malloc | |
12 | G_DEBUG=gc-friendly | |
13 | VALGRIND="valgrind -v --tool=memcheck --leak-check=full --num-callers=40 --error-exitcode=1" | |
14 | ${VALGRIND} --log-file=${test_suite}.val.log ./${test_suite} || ({ echo "Valgrind memory check error"; exit 1; }) | |
15 | } |