blob: ad8cc74bc781a321b9353d2324aed0ed1a186ea4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/bin/bash -e
SUFFIX="$(date "+%Y%m%d-%H%M%S.%6N.$$")"
rc=0
libtool \
--mode=execute \
valgrind \
--log-file="$NFT_TEST_TESTTMPDIR/valgrind.$SUFFIX.%p.log" \
--trace-children=yes \
--leak-check=full \
--show-leak-kinds=all \
--num-callers=100 \
--error-exitcode=122 \
$NFT_TEST_VALGRIND_OPTS \
"$NFT_REAL" \
"$@" \
|| rc=$?
if [ "$rc" -eq 122 ] ; then
shopt -s nullglob
FILES=( "$NFT_TEST_TESTTMPDIR/valgrind.$SUFFIX."*".log" )
shopt -u nullglob
(
printf '%s\n' "args: $*"
printf '%s\n' "${FILES[*]}"
) >> "$NFT_TEST_TESTTMPDIR/rc-failed-valgrind"
fi
exit $rc
|