summaryrefslogtreecommitdiff
path: root/t/test-lib-functions.sh
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2017-03-18 16:13:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-18 17:18:20 (GMT)
commit4ecae3c8c182a7d3bd27b6e0e0afd0000f825d8e (patch)
tree60e33c8a5a13ddbc67dbc7870c39d7b833fa6675 /t/test-lib-functions.sh
parent7c9c2f8c394a4c1f4e09d6d5542c4e7965cc9240 (diff)
downloadgit-4ecae3c8c182a7d3bd27b6e0e0afd0000f825d8e.zip
git-4ecae3c8c182a7d3bd27b6e0e0afd0000f825d8e.tar.gz
git-4ecae3c8c182a7d3bd27b6e0e0afd0000f825d8e.tar.bz2
tests: create an interactive gdb session with the 'debug' helper
The 'debug' test helper is supposed to facilitate debugging by running a command of the test suite under gdb. Unfortunately, its usefulness is severely limited, because that gdb session is not interactive, since the test's, and thus gdb's standard input is redirected from /dev/null (for a good reason, see 781f76b15 (test-lib: redirect stdin of tests, 2011-12-15)). Redirect gdb's standard file descriptors from/to the test environment's stdin, stdout and stderr in the 'debug' helper, thus creating an interactive gdb session (even in non-verbose mode), which is much, much more useful. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib-functions.sh')
-rw-r--r--t/test-lib-functions.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index bd35770..4a50a61 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -154,7 +154,7 @@ test_pause () {
#
# Example: "debug git checkout master".
debug () {
- GIT_TEST_GDB=1 "$@"
+ GIT_TEST_GDB=1 "$@" <&6 >&5 2>&7
}
# Call test_commit with the arguments