@matheusbsbs / matheus-bagliano / commits / 5caa81d1b4
Fork 0

valgrind: do not require valgrind 3.4.0 or newer

Valgrind 3.4.0 is pretty new, and even if --track-origins is a nice feature, it is not the end of the world if that is not available. So play nice and use that option only when only an older version of valgrind is available. In the same spirit, refrain from the use of '...' in suppression files, which is also a feature only valgrind 3.4 and newer understand. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Feb 5, 2009 at 22:03 UTC 5caa81d1b4f1b0b9ed73605ab1e4d91ba31a56b4
2 files changed +13 -2
t/valgrind/default.supp
+3 -1
@@ -38,6 +38,8 @@
38 writing-data-from-zlib-triggers-even-more-errors
39 Memcheck:Param
40 write(buf)
41 - ...
41 + obj:/lib/ld-*.so
42 + fun:write_in_full
43 + fun:write_buffer
44 fun:write_loose_object
45 }
t/valgrind/valgrind.sh
+10 -1
@@ -2,11 +2,20 @@
2
3 base=$(basename "$0")
4
5 +TRACK_ORIGINS=
6 +
7 +VALGRIND_VERSION=$(valgrind --version)
8 +VALGRIND_MAJOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*\([0-9]*\)')
9 +VALGRIND_MINOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*[0-9]*\.\([0-9]*\)')
10 +test 3 -gt "$VALGRIND_MAJOR" ||
11 +test 3 -eq "$VALGRIND_MAJOR" -a 4 -gt "$VALGRIND_MINOR" ||
12 +TRACK_ORIGINS=--track-origins=yes
13 +
14 exec valgrind -q --error-exitcode=126 \
15 --leak-check=no \
16 --suppressions="$GIT_VALGRIND/default.supp" \
17 --gen-suppressions=all \
9 - --track-origins=yes \
18 + $TRACK_ORIGINS \
19 --log-fd=4 \
20 --input-fd=4 \
21 $GIT_VALGRIND_OPTIONS \