diff options
-rw-r--r-- | m4/valgrind-tests.m4 | 1 | ||||
-rw-r--r-- | tests/random.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/m4/valgrind-tests.m4 b/m4/valgrind-tests.m4 index 422f402..926d75c 100644 --- a/m4/valgrind-tests.m4 +++ b/m4/valgrind-tests.m4 @@ -24,6 +24,7 @@ AC_DEFUN([gl_VALGRIND_TESTS], if test -n "$VALGRIND" && $VALGRIND -q true > /dev/null 2>&1; then opt_valgrind_tests=yes VALGRIND="$VALGRIND -q --error-exitcode=1 --leak-check=full" + AC_DEFINE([MPC_USE_VALGRIND], 1, [Use valgrind for make check]) else opt_valgrind_tests=no VALGRIND= diff --git a/tests/random.c b/tests/random.c index 1c5cdb5..587463c 100644 --- a/tests/random.c +++ b/tests/random.c @@ -48,7 +48,10 @@ test_start (void) char *environment_seed; unsigned long seed; + /* if we use valgrind, no need to have our own memory check */ +#ifndef MPC_USE_VALGRIND tests_memory_start (); +#endif if (rands_initialized) { @@ -98,7 +101,9 @@ test_end (void) gmp_randclear (rands); } mpfr_free_cache (); +#ifndef MPC_USE_VALGRIND tests_memory_end (); +#endif } /* Set z to a non zero value random value with absolute values of Re(z) and |