add configure option to run tests without valgrind
This commit is contained in:
1 parent
1defaa7b00
commit
d7e35101c5
3 files changed
+17
-1
No files matched your search
@@ -47,6 +47,14 @@ libjq_la_LDFLAGS = -export-symbols-regex '^j[qv]_' -version-info 1:4:0
|
|||||||
|
|
||||||
include_HEADERS = jv.h jq.h
|
include_HEADERS = jv.h jq.h
|
||||||
|
|
||||||
|
### Running tests under Valgrind
|
||||||
|
|
||||||
|
if ENABLE_VALGRIND
|
||||||
|
NO_VALGRIND =
|
||||||
|
else
|
||||||
|
NO_VALGRIND = 1
|
||||||
|
endif
|
||||||
|
|
||||||
### Error injection for testing
|
### Error injection for testing
|
||||||
|
|
||||||
if ENABLE_ERROR_INJECTION
|
if ENABLE_ERROR_INJECTION
|
||||||
@@ -80,6 +88,7 @@ endif
|
|||||||
### Tests (make check)
|
### Tests (make check)
|
||||||
|
|
||||||
TESTS = tests/mantest tests/jqtest tests/onigtest tests/shtest
|
TESTS = tests/mantest tests/jqtest tests/onigtest tests/shtest
|
||||||
|
TESTS_ENVIRONMENT = NO_VALGRIND=$(NO_VALGRIND)
|
||||||
|
|
||||||
|
|
||||||
### Building the manpage
|
### Building the manpage
|
||||||
|
|||||||
@@ -83,6 +83,12 @@ AC_CHECK_FUNCS(memmem)
|
|||||||
AC_CHECK_FUNCS(mkstemp)
|
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
|
dnl Don't attempt to build docs if there's no Ruby lying around
|
||||||
AC_ARG_ENABLE([docs],
|
AC_ARG_ENABLE([docs],
|
||||||
AC_HELP_STRING([--disable-docs], [don't build docs]))
|
AC_HELP_STRING([--disable-docs], [don't build docs]))
|
||||||
@@ -119,6 +125,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AM_CONDITIONAL([ENABLE_VALGRIND], [test "x$enable_valgrind" != xno])
|
||||||
AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" != xno])
|
AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" != xno])
|
||||||
AM_CONDITIONAL([ENABLE_ERROR_INJECTION], [test "x$enable_error_injection" = xyes])
|
AM_CONDITIONAL([ENABLE_ERROR_INJECTION], [test "x$enable_error_injection" = xyes])
|
||||||
AM_CONDITIONAL([ENABLE_ALL_STATIC], [test "x$enable_all_static" = xyes])
|
AM_CONDITIONAL([ENABLE_ALL_STATIC], [test "x$enable_all_static" = xyes])
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ JQTESTDIR=$(cd "$(dirname "$0")" && pwd)
|
|||||||
JQBASEDIR=$JQTESTDIR/..
|
JQBASEDIR=$JQTESTDIR/..
|
||||||
JQ=$JQBASEDIR/jq
|
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 \
|
VALGRIND="valgrind --error-exitcode=1 --leak-check=full \
|
||||||
--suppressions=$JQTESTDIR/onig.supp"
|
--suppressions=$JQTESTDIR/onig.supp"
|
||||||
Q=-q
|
Q=-q
|
||||||
|
|||||||
Reference in new issue
Block a user