Skip to content

Commit dfdf17d

Browse files
committed
Tests: optionally skip redirecting stdin/stdout/stderr
There is a really useful debugging technique developed by Sverre Rabbelier that inserts "bash &&" somewhere in the test scripts, letting the developer interact at given points with the current state. Another debugging technique, used a lot by this here coder, is to run certain executables via gdb by guarding a "gdb -args" call in bin-wrappers/git. Both techniques were disabled by 781f76b(test-lib: redirect stdin of tests). Let's reinstate the ability to run an interactive shell by making the redirection optional: setting the TEST_NO_REDIRECT environment variable will skip the redirection. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent e8b5e1d commit dfdf17d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

t/test-lib.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,12 @@ test_eval_ () {
646646
# be _inside_ the block to avoid polluting the "set -x" output
647647
#
648648

649-
test_eval_inner_ "$@" </dev/null >&3 2>&4
649+
if test -n "$TEST_NO_REDIRECT"
650+
then
651+
test_eval_inner_ "$@"
652+
else
653+
test_eval_inner_ "$@" </dev/null >&3 2>&4
654+
fi
650655
{
651656
test_eval_ret_=$?
652657
if want_trace

0 commit comments

Comments
 (0)