Permalink
Browse files

add optional testing under valgrind (./configure --enable-valgrind-te…

…sting)

git-svn-id: http://svn.metadecks.org/libremix/trunk@336 e2d53364-18fc-0310-981e-b60a84739af0
  • Loading branch information...
1 parent 447f11f commit c7314fb6aed2be1aa869490e0f6b8b1fd1dee716 conrad committed Jan 30, 2006
Showing with 26 additions and 0 deletions.
  1. +24 −0 configure.ac
  2. +2 −0 src/tests/Makefile.am
View
@@ -16,6 +16,30 @@ if test $HAVE_DOXYGEN = "false"; then
AC_MSG_WARN([*** doxygen not found, docs will not be built])
fi
+# Check for valgrind
+VALGRIND_ENVIRONMENT=""
+ac_enable_valgrind=no
+AC_ARG_ENABLE(valgrind-testing,
+ [ --enable-valgrind-testing enable running of tests inside Valgrind ], [ ac_enable_valgrind=yes ], [ ac_enable_valgrind=no] )
+
+if test "x${ac_enable_valgrind}" = xyes ; then
+ if test "x${enable_shared}" = xyes ; then
+ VALGRIND_ENVIRONMENT="libtool --mode=execute "
+ fi
+
+ AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
+ if test "x$HAVE_VALGRIND" = xyes ; then
+ VALGRIND_ENVIRONMENT="$VALGRIND_ENVIRONMENT valgrind -q --leak-check=yes --show-reachable=yes --num-callers=100"
+ AC_SUBST(VALGRIND_ENVIRONMENT)
+ TESTS_INFO="'make check' test suite will be run under:
+ ${VALGRIND_ENVIRONMENT}"
+ else
+ TESTS_INFO="'make check' to run test suite (Valgrind not found)"
+ fi
+else
+ TESTS_INFO="'make check' to run test suite (Valgrind testing not enabled)"
+fi
+
dnl
dnl Configuration option for building of experimental code.
dnl
View
@@ -8,6 +8,8 @@ REMIX_LIBS = ../ctxdata/libctxdata.la ../libremix/libremix.la -ldl
# Test programs
+TESTS_ENVIRONMENT = $(VALGRIND_ENVIRONMENT)
+
test: check
TESTS = noop sndfiletest

0 comments on commit c7314fb

Please sign in to comment.