summaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorLibravatar Thomas Rast <trast@inf.ethz.ch>2013-03-31 10:00:16 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-04-01 07:45:37 -0700
commit952af3511c5dc7b7efd4c374d8b56d2c11d09d07 (patch)
treea38bb13d8c3d4f80547cd2848866d540b2e93423 /t/test-lib.sh
parentt/README: --valgrind already implies -v (diff)
downloadtgif-952af3511c5dc7b7efd4c374d8b56d2c11d09d07.tar.xz
tests: parameterize --valgrind option
Running tests under helgrind and DRD recently proved useful in tracking down thread interaction issues. This can unfortunately not be done through GIT_VALGRIND_OPTIONS because any tool other than memcheck would complain about unknown options. Let --valgrind take an optional parameter that describes the valgrind tool to invoke. The default mode is to run memcheck as before. Signed-off-by: Thomas Rast <trast@inf.ethz.ch> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 1f510252ad..da57a2f45c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -193,7 +193,11 @@ do
--no-color)
color=; shift ;;
--va|--val|--valg|--valgr|--valgri|--valgrin|--valgrind)
- valgrind=t; verbose=t; shift ;;
+ valgrind=memcheck
+ shift ;;
+ --valgrind=*)
+ valgrind=$(expr "z$1" : 'z[^=]*=\(.*\)')
+ shift ;;
--tee)
shift ;; # was handled already
--root=*)
@@ -204,6 +208,8 @@ do
esac
done
+test -n "$valgrind" && verbose=t
+
if test -n "$color"
then
say_color () {
@@ -530,6 +536,8 @@ then
PATH=$GIT_VALGRIND/bin:$PATH
GIT_EXEC_PATH=$GIT_VALGRIND/bin
export GIT_VALGRIND
+ GIT_VALGRIND_MODE="$valgrind"
+ export GIT_VALGRIND_MODE
elif test -n "$GIT_TEST_INSTALLED"
then
GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path) ||