Disable Valgrind by default during testing (#3269)

Previously, the configure script automatically enables Valgrind during
testing when the valgrind command is found. However, running tests with
Valgrind is quite slow, so it is better to disable it by default, and
to enable it only when the user specifies the `--enable-valgrind` flag.
This commit is contained in:
itchyny authored and GitHub committed 2025-03-04 22:12:25 +09:00
1 parent c4e1fb08fb
commit 5df471fa5b
8 files changed
+19 -29

No files matched your search

+11 -12
View File
@@ -65,23 +65,18 @@ endif
include_HEADERS = src/jv.h src/jq.h
if ENABLE_UBSAN
AM_CFLAGS += -fsanitize=undefined
endif
AM_CPPFLAGS = -I$(srcdir)/src -I$(srcdir)/vendor
### Running tests under Valgrind
### Address sanitizer (ASan)
if ENABLE_ASAN
AM_CFLAGS += -fsanitize=address
NO_VALGRIND = 1
else
if ENABLE_VALGRIND
NO_VALGRIND =
else
NO_VALGRIND = 1
endif
### Undefined Behavior Sanitizer
if ENABLE_UBSAN
AM_CFLAGS += -fsanitize=undefined
endif
### Code coverage with gcov
@@ -127,7 +122,11 @@ TESTS = tests/mantest tests/jqtest tests/shtest tests/utf8test tests/base64test
if !WIN32
TESTS += tests/optionaltest
endif
AM_TESTS_ENVIRONMENT = JQ=$(abs_builddir)/jq NO_VALGRIND=$(NO_VALGRIND)
AM_TESTS_ENVIRONMENT = JQ=$(abs_builddir)/jq
if ENABLE_VALGRIND
AM_TESTS_ENVIRONMENT += ENABLE_VALGRIND=1
endif
# This is a magic make variable that causes it to treat tests/man.test as a
# DATA-type dependency for the check target. As a result, it will attempt to