0
4
2
| 1 |
#!/bin/sh |
|
| 2 |
|
|
| 3 |
# Run in valgrind, with leak checking enabled |
|
| 4 |
|
|
| 5 |
valgrind -q --leak-check=full "$@" 2> .valgrind-log |
|
| 6 |
|
|
| 7 |
# Save the test result |
|
| 8 |
|
|
| 9 |
result="$?" |
|
| 10 |
|
|
| 11 |
# Valgrind should generate no error messages |
|
| 12 |
|
|
| 13 |
log_contents="`cat .valgrind-log`" |
|
| 14 |
|
|
| 15 |
if [ "$log_contents" != "" ]; then |
|
| 16 |
cat .valgrind-log >&2 |
|
| 17 |
result=1 |
|
| 18 |
fi |
|
| 19 |
|
|
| 20 |
rm -f .valgrind-log |
|
| 21 |
|
|
| 22 |
exit $result |
| ... | ... |
@@ -83,6 +83,21 @@ |
| 83 | 83 |
fi |
| 84 | 84 |
AM_CONDITIONAL([WANT_TOOLS], [test x"$enable_tools" != x"no"]) |
| 85 | 85 |
|
| 86 |
dnl Support for running test cases using valgrind. |
|
| 87 |
use_valgrind=no |
|
| 88 |
AC_ARG_ENABLE([valgrind], |
|
| 89 |
AS_HELP_STRING([--enable-valgrind], [use valgrind when running tests]), |
|
| 90 |
[use_valgrind=yes]) |
|
| 91 |
|
|
| 92 |
if [[ "$use_valgrind" = "yes" ]]; then |
|
| 93 |
AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no) |
|
| 94 |
|
|
| 95 |
if [[ "$HAVE_VALGRIND" = "no" ]]; then |
|
| 96 |
AC_MSG_ERROR([Valgrind not found in PATH.]) |
|
| 97 |
fi |
|
| 98 |
fi |
|
| 99 |
AM_CONDITIONAL(USE_VALGRIND, [test "$use_valgrind" = "yes"]) |
|
| 100 |
|
|
| 86 | 101 |
dnl Checks for header files. |
| 87 | 102 |
AC_CHECK_HEADERS(limits.h sys/time.h sys/times.h unistd.h) |
| 88 | 103 |
|
| ... | ... |
@@ -128,6 +143,7 @@ |
| 128 | 143 |
echo CBC support................... : $lx_cbc_found |
| 129 | 144 |
echo |
| 130 | 145 |
echo Build additional tools........ : $enable_tools |
| 146 |
echo Use valgrind for tests........ : $use_valgrind |
|
| 131 | 147 |
echo |
| 132 | 148 |
echo The packace will be installed in |
| 133 | 149 |
echo -n ' ' |
0 comments (0 inline)