From 9a0d285c9735ed65be2c63ba0db2c9d864bf7407 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Fri, 25 Nov 2011 00:20:17 +0100 Subject: [PATCH] valgrind-tests.m4: Avoid breakage if valgrind on bash fails. * m4/valgrind-tests.m4: Check that the parameters that will be used works, not just a subset of them. Reported by Bruno Haible . --- ChangeLog | 7 +++++++ m4/valgrind-tests.m4 | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fd82024b7..8dff9d9e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-11-25 Simon Josefsson + + valgrind-tests.m4: Avoid breakage if valgrind on bash fails. + * m4/valgrind-tests.m4: Check that the parameters that will be + used works, not just a subset of them. Reported by Bruno Haible + . + 2011-11-24 Jim Meyering test-stdalign.c: comment out long double tests diff --git a/m4/valgrind-tests.m4 b/m4/valgrind-tests.m4 index ab9e25a84..0a2a9a832 100644 --- a/m4/valgrind-tests.m4 +++ b/m4/valgrind-tests.m4 @@ -1,4 +1,4 @@ -# valgrind-tests.m4 serial 2 +# valgrind-tests.m4 serial 3 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -21,9 +21,12 @@ AC_DEFUN([gl_VALGRIND_TESTS], AC_CHECK_PROGS(VALGRIND, valgrind) fi - if test -n "$VALGRIND" && $VALGRIND -q true > /dev/null 2>&1; then + OPTS="-q --error-exitcode=1 --leak-check=full" + + if test -n "$VALGRIND" \ + && $VALGRIND $OPTS $SHELL -c 'exit 0' > /dev/null 2>&1; then opt_valgrind_tests=yes - VALGRIND="$VALGRIND -q --error-exitcode=1 --leak-check=full" + VALGRIND="$VALGRIND $OPTS" else opt_valgrind_tests=no VALGRIND= -- 2.11.0