From d258b124a2e062a3b1adc7f6a7baef9d276020c4 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 10 Jun 2016 13:28:08 +0200 Subject: [PATCH] tests: Exit valgrind tests if a leak is detected This fails the test if OT_TESTS_VALGRIND is set and valgrind detects a leak. Closes: #334 Approved by: cgwalters --- tests/libtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/libtest.sh b/tests/libtest.sh index 2916bdbb..3350cb20 100755 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -77,7 +77,7 @@ if test -n "${OT_TESTS_DEBUG:-}"; then fi if test -n "${OT_TESTS_VALGRIND:-}"; then - CMD_PREFIX="env G_SLICE=always-malloc OSTREE_SUPPRESS_SYNCFS=1 valgrind -q --leak-check=full --num-callers=30 --suppressions=${test_srcdir}/glib.supp --suppressions=${test_srcdir}/ostree.supp" + CMD_PREFIX="env G_SLICE=always-malloc OSTREE_SUPPRESS_SYNCFS=1 valgrind -q --error-exitcode=1 --leak-check=full --num-callers=30 --suppressions=${test_srcdir}/glib.supp --suppressions=${test_srcdir}/ostree.supp" else CMD_PREFIX="env LD_PRELOAD=${test_builddir}/libreaddir-rand.so" fi