From ebd47557f03bc059d62ce740701b7328884b3e37 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 3 May 2020 19:34:47 +0300 Subject: [PATCH] mdbx-make: refine 'test-valgrind' target. Change-Id: I2de34502157476a1bc516d125c9fdf40c987f77f --- GNUmakefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 946aa3c6..2d8c0988 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -187,14 +187,15 @@ test-fault: all mdbx_test ; ./mdbx_chk -vvnw $(TEST_DB) && ([ ! -e $(TEST_DB)-copy ] || ./mdbx_chk -vvn $(TEST_DB)-copy) VALGRIND=valgrind --trace-children=yes --log-file=valgrind-%p.log --leak-check=full --track-origins=yes --error-exitcode=42 --suppressions=test/valgrind_suppress.txt -memcheck test-valgrind: all mdbx_test - @echo "$(MDBX_OPTIONS)" | grep -q MDBX_USE_VALGRIND || echo "WARNING: Please build libmdbx with -DMDBX_USE_VALGRIND to avoid false-positives from Valgrind !!!" >&2 - rm -f valgrind-*.log $(TEST_DB) $(TEST_LOG) && (set -o pipefail; \ - ($(VALGRIND) ./mdbx_test --mode=-writemap,-mapasync,-lifo --progress --console=no --repeat=4 --pathname=$(TEST_DB) --dont-cleanup-after basic && \ +memcheck test-valgrind: + $(MAKE) clean && $(MAKE) CFLAGS_EXTRA="-Ofast -DMDBX_USE_VALGRIND" build-test && \ + rm -f valgrind-*.log $(TEST_DB) $(TEST_LOG) && (set -o pipefail; ( \ + $(VALGRIND) ./mdbx_test --progress --console=no --repeat=2 --pathname=$(TEST_DB) --dont-cleanup-after basic && \ $(VALGRIND) ./mdbx_test --progress --console=no --pathname=$(TEST_DB) --dont-cleanup-before --dont-cleanup-after --copy && \ - $(VALGRIND) ./mdbx_test --progress --console=no --repeat=2 --pathname=$(TEST_DB) --dont-cleanup-after basic) \ - | tee >(gzip --stdout > $(TEST_LOG)) | tail -n 42) \ - && $(VALGRIND) ./mdbx_chk -vvn $(TEST_DB) && ./mdbx_chk -vvn $(TEST_DB)-copy + $(VALGRIND) ./mdbx_test --mode=-writemap,-mapasync,-lifo --progress --console=no --repeat=4 --pathname=$(TEST_DB) --dont-cleanup-after basic && \ + $(VALGRIND) ./mdbx_chk -vvn $(TEST_DB) && \ + $(VALGRIND) ./mdbx_chk -vvn $(TEST_DB)-copy \ + ) | tee >(gzip --stdout > $(TEST_LOG)) | tail -n 42) define test-rule $(patsubst %.cc,%.o,$(1)): $(1) $(TEST_INC) mdbx.h $(lastword $(MAKEFILE_LIST))