add configure option to run tests without valgrind

This commit is contained in:
David Tolnay committed 2015-06-27 11:24:53 -07:00
1 parent 1defaa7b00
commit d7e35101c5
3 files changed
+17 -1

No files matched your search

+9
View File
@@ -47,6 +47,14 @@ libjq_la_LDFLAGS = -export-symbols-regex '^j[qv]_' -version-info 1:4:0
include_HEADERS = jv.h jq.h
### Running tests under Valgrind
if ENABLE_VALGRIND
NO_VALGRIND =
else
NO_VALGRIND = 1
endif
### Error injection for testing
if ENABLE_ERROR_INJECTION
@@ -80,6 +88,7 @@ endif
### Tests (make check)
TESTS = tests/mantest tests/jqtest tests/onigtest tests/shtest
TESTS_ENVIRONMENT = NO_VALGRIND=$(NO_VALGRIND)
### Building the manpage
+7
View File
@@ -83,6 +83,12 @@ AC_CHECK_FUNCS(memmem)
AC_CHECK_FUNCS(mkstemp)
dnl Running tests with Valgrind is slow. It is faster to iterate on
dnl code without Valgrind until tests pass, then enable Valgrind and
dnl fix leaks.
AC_ARG_ENABLE([valgrind],
AC_HELP_STRING([--disable-valgrind], [do not run tests under Valgrind]))
dnl Don't attempt to build docs if there's no Ruby lying around
AC_ARG_ENABLE([docs],
AC_HELP_STRING([--disable-docs], [don't build docs]))
@@ -119,6 +125,7 @@ EOF
fi
])
AM_CONDITIONAL([ENABLE_VALGRIND], [test "x$enable_valgrind" != xno])
AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" != xno])
AM_CONDITIONAL([ENABLE_ERROR_INJECTION], [test "x$enable_error_injection" = xyes])
AM_CONDITIONAL([ENABLE_ALL_STATIC], [test "x$enable_all_static" = xyes])
+1 -1
View File
@@ -8,7 +8,7 @@ JQTESTDIR=$(cd "$(dirname "$0")" && pwd)
JQBASEDIR=$JQTESTDIR/..
JQ=$JQBASEDIR/jq
if which valgrind > /dev/null; then
if [ -z "${NO_VALGRIND-}" ] && which valgrind > /dev/null; then
VALGRIND="valgrind --error-exitcode=1 --leak-check=full \
--suppressions=$JQTESTDIR/onig.supp"
Q=-q