]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
autotools: detect presence of valgrind
authorJason Dillaman <dillaman@redhat.com>
Tue, 28 Apr 2015 01:30:26 +0000 (21:30 -0400)
committerjdillaman <jdillaman@ubuntu.(none)>
Thu, 30 Apr 2015 14:56:54 +0000 (10:56 -0400)
Conditionally enable running librbd unit tests under valgrind.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
configure.ac
src/test/Makefile-client.am

index 5a73f68bd7e7b747da34a9daf76b3e9f749763fa..3cddd977a7f19a4d46534da53adb227c450162ea 100644 (file)
@@ -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
index f3b70ac11428ae4b0acffcc412a774c8aa151cfb..db2ad0eb550bd151e6a2819d9b2b1787d5826ef1 100644 (file)
@@ -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