]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/openssh/regress/valgrind-unit.sh
stand/powerpc: Only build loader.kboot for powerpc64
[FreeBSD/FreeBSD.git] / crypto / openssh / regress / valgrind-unit.sh
1 #!/bin/sh
2
3 UNIT_BINARY="$1"
4 shift
5 UNIT_ARGS="$@"
6
7 test "x$OBJ" = "x" && OBJ=$PWD
8
9 # This mostly replicates the logic in test-exec.sh for running the
10 # regress tests under valgrind, except that we unconditionally enable
11 # leak checking because the unit tests should be clean.
12 VG_LEAK="--leak-check=full"
13 VG_TEST=`basename $UNIT_BINARY`
14 VG_LOG="$OBJ/valgrind-out/${VG_TEST}.%p"
15 VG_OPTS="--track-origins=yes $VG_LEAK --log-file=${VG_LOG}"
16 VG_OPTS="$VG_OPTS --trace-children=yes"
17 VG_PATH="valgrind"
18 if [ "x$VALGRIND_PATH" != "x" ]; then
19         VG_PATH="$VALGRIND_PATH"
20 fi
21
22 exec $VG_PATH $VG_OPTS $UNIT_BINARY $UNIT_ARGS