forked from collectd/collectd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testwrapper.sh
executable file
·30 lines (23 loc) · 718 Bytes
/
testwrapper.sh
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
#! /bin/sh
#
# collectd -- testwrapper.sh
#
# A wrapper script for running tests. If valgrind is available, memory
# checking will be enabled for all tests.
set -e
MEMCHECK=""
if test -n "$VALGRIND"; then
MEMCHECK="$VALGRIND --quiet --tool=memcheck --error-exitcode=1"
MEMCHECK="$MEMCHECK --trace-children=yes"
MEMCHECK="$MEMCHECK --leak-check=full"
MEMCHECK="$MEMCHECK --gen-suppressions=all"
for f in "valgrind.$( uname -s ).suppress" "valgrind.suppress"; do
filename="$( dirname "$0" )/src/$f"
if test -e "$filename"; then
# Valgrind supports up to 100 suppression files.
MEMCHECK="$MEMCHECK --suppressions=$filename"
fi
done
fi
exec $MEMCHECK "$@"
# vim: set tw=78 sw=4 ts=4 noexpandtab :