Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-23 08:38:15 +0300
committerJunio C Hamano <gitster@pobox.com>2018-05-23 08:38:15 +0300
commit89753dc2b72d838c0bae22ef708201b6473a1244 (patch)
treee7a4daa36fd4a5616f602c9ac7b5878b87b7ef0f /t
parent41267e96972d5a158298f777caecd7433a1b1a94 (diff)
parent842436466aa5d9f1e5f1a09d41d22d902006219c (diff)
Merge branch 'en/git-debugger'
Dev support. * en/git-debugger: Make running git under other debugger-like programs easy
Diffstat (limited to 't')
-rw-r--r--t/test-lib-functions.sh24
1 files changed, 20 insertions, 4 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 7d620bf2a9..c55ef099c3 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -145,12 +145,28 @@ test_pause () {
"$SHELL_PATH" <&6 >&5 2>&7
}
-# Wrap git in gdb. Adding this to a command can make it easier to
-# understand what is going on in a failing test.
+# Wrap git with a debugger. Adding this to a command can make it easier
+# to understand what is going on in a failing test.
#
-# Example: "debug git checkout master".
+# Examples:
+# debug git checkout master
+# debug --debugger=nemiver git $ARGS
+# debug -d "valgrind --tool=memcheck --track-origins=yes" git $ARGS
debug () {
- GIT_TEST_GDB=1 "$@" <&6 >&5 2>&7
+ case "$1" in
+ -d)
+ GIT_DEBUGGER="$2" &&
+ shift 2
+ ;;
+ --debugger=*)
+ GIT_DEBUGGER="${1#*=}" &&
+ shift 1
+ ;;
+ *)
+ GIT_DEBUGGER=1
+ ;;
+ esac &&
+ GIT_DEBUGGER="${GIT_DEBUGGER}" "$@" <&6 >&5 2>&7
}
# Call test_commit with the arguments