From: Jason Dillaman Date: Tue, 28 Apr 2015 01:30:26 +0000 (-0400) Subject: autotools: detect presence of valgrind X-Git-Tag: v9.0.1~47^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6e84ceb418249f56fd41e32c04aa29462c1197f3;p=ceph.git autotools: detect presence of valgrind Conditionally enable running librbd unit tests under valgrind. Signed-off-by: Jason Dillaman --- diff --git a/configure.ac b/configure.ac index 5a73f68bd7e7..3cddd977a7f1 100644 --- a/configure.ac +++ b/configure.ac @@ -1122,7 +1122,16 @@ AM_COND_IF([WITH_BABELTRACE], [ AC_MSG_ERROR([babeltrace/ctf/events.h not found (libbabeltrace-ctf-dev, libbabeltrace-devel)])) ]) - +dnl check for valgrind +AC_ARG_ENABLE([valgrind], + [AS_HELP_STRING([--enable-valgrind], [enable valgrind unit tests])], + [enable_valgrind=$enableval], [enable_valgrind=]) +AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes) +AS_IF([test "x$HAVE_VALGRIND" = "x"], + AS_IF([test "x$enable_valgrind" = "xyes"], [AC_MSG_ERROR([valgrind not found])]), + [test "x$enable_valgrind" = "x"], [enable_valgrind=yes]) + +AM_CONDITIONAL([VALGRIND_ENABLED], [test "x$enable_valgrind" = "xyes"]) # Checks for typedefs, structures, and compiler characteristics. #AC_HEADER_STDBOOL diff --git a/src/test/Makefile-client.am b/src/test/Makefile-client.am index f3b70ac11428..db2ad0eb550b 100644 --- a/src/test/Makefile-client.am +++ b/src/test/Makefile-client.am @@ -317,7 +317,10 @@ unittest_librbd_LDADD = \ $(CEPH_GLOBAL) $(RADOS_TEST_LDADD) check_PROGRAMS += unittest_librbd check_SCRIPTS += test/run-rbd-unit-tests.sh + +if VALGRIND_ENABLED check_SCRIPTS += test/run-rbd-valgrind-unit-tests.sh +endif ceph_test_librbd_SOURCES = nodist_EXTRA_ceph_test_librbd_SOURCES = dummy.cc