File: valgrind.sh

package info (click to toggle)
libnice 0.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,840 kB
  • sloc: ansic: 19,186; sh: 11,071; makefile: 348
file content (24 lines) | stat: -rwxr-xr-x 425 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

export G_SLICE=always-malloc
export G_DEBUG=gc-friendly

report=`libtool --mode=execute valgrind \
	--leak-check=full \
	--show-reachable=no \
	--error-exitcode=1 \
	$1 2>&1`

#if echo "$report" | grep -q ==; then
if test $? != 0; then
	echo "$report"
	exit 1
fi

if echo "$report" | grep -q "definitely lost"; then
	if ! echo "$report" | grep -q "definitely lost: 0 bytes"; then
		echo "$report"
		exit 1
	fi
fi