aboutsummaryrefslogtreecommitdiff
blob: ad02269e9ede7ededdb1e7fdb82461bd07c8a154 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash

# --errors-for-leak-kinds= drop possible due to Solaris libc/_findbuf
valgrind \
	--leak-check=full \
	--track-fds=yes \
	--malloc-fill=0xdb \
	--free-fill=0xbd \
	--log-file=q-valgrind.log \
	--errors-for-leak-kinds=definite \
	--error-exitcode=234 \
	"${@}"
ret=$?
if [[ ${ret} == 234 ]] ; then
	mv q-valgrind.log q-valgrind.$$.log
	echo "valgrind log can be found at ${PWD}/q-valgrind.$$.log" > /dev/stderr
	# dump complaints in Travis' log, as we cannot retrieve them lateron
	[[ -n ${TRAVIS_OS_NAME} ]] && cat q-valgrind.$$.log > /dev/stderr
else
	rm q-valgrind.log
fi

exit ${ret}