summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-04-18 17:28:47 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-04-18 17:28:47 +0100
commit58a5b5bd944655b028c915a91dad2220176986db (patch)
tree78ed5164b5ab14995628309f8e5b1f0548c2e7ea
parent5d6a323b9358bb01233681b784fa67414a5d2c6d (diff)
downloadlibguestfs-58a5b5bd944655b028c915a91dad2220176986db.tar.gz
libguestfs-58a5b5bd944655b028c915a91dad2220176986db.tar.xz
libguestfs-58a5b5bd944655b028c915a91dad2220176986db.zip
extra-tests: Check if valgrind supports --vgdb=no option.
This option didn't exist in RHEL 6 valgrind.
-rw-r--r--configure.ac14
-rw-r--r--tests/extra/Makefile.am6
2 files changed, 17 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index c62bf9a4..ea2533a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -714,6 +714,20 @@ dnl The C++ compiler test is pretty useless because even if it fails
dnl it sets CXX=g++. So test the compiler actually works.
AM_CONDITIONAL([HAVE_CXX], [$CXX --version])
+dnl If valgrind is present (it's not required), check whether or not
+dnl it supports the new 'valgrind --vgdb' option.
+AC_CHECK_PROG([VALGRIND],[valgrind],[valgrind],[no])
+AS_IF([test "x$valgrind" != "xno"],[
+ AC_MSG_CHECKING([if $VALGRIND supports the --vgdb option])
+ if $VALGRIND --help | grep -sq -- --vgdb; then
+ AC_MSG_RESULT([yes])
+ AC_SUBST([VALGRIND_NO_VGDB],[--vgdb=no])
+ else
+ AC_MSG_RESULT([no])
+ AC_SUBST([VALGRIND_NO_VGDB],[])
+ fi
+])
+
dnl Check for OCaml (optional, for OCaml bindings).
OCAMLC=no
OCAMLFIND=no
diff --git a/tests/extra/Makefile.am b/tests/extra/Makefile.am
index 2085cc80..911c83eb 100644
--- a/tests/extra/Makefile.am
+++ b/tests/extra/Makefile.am
@@ -50,12 +50,12 @@
EXTRA_DIST = pick-guests.pl suppressions
-VG = valgrind \
+VG = $(VALGRIND) \
+ $(VALGRIND_NO_VGDB) \
--log-file=$(abs_builddir)/valgrind.log \
--leak-check=full \
--error-exitcode=119 \
- --suppressions=$(abs_srcdir)/suppressions \
- --vgdb=no
+ --suppressions=$(abs_srcdir)/suppressions
RUN_VG = $(abs_top_builddir)/run $(VG)
export LIBVIRT_DEFAULT_URI = \