Skip to content

Commit 59210dd

Browse files
szedergitster
authored andcommitted
tests: make the 'test_pause' helper work in non-verbose mode
When the 'test_pause' helper function invokes the shell mid-test, it explicitly redirects the shell's stdout and stderr to file descriptors 3 and 4, which are the stdout and stderr of the tests (i.e. where they would be connected anyway without those redirections). These file descriptors are only attached to the terminal in verbose mode, hence the restriction of 'test_pause' to work only with '-v'. Redirect the shell's stdout and stderr to the test environment's original stdout and stderr, allowing it to work properly even in non-verbose mode, and the restriction can be lifted. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 4ecae3c commit 59210dd

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

t/test-lib-functions.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,12 @@ test_tick () {
136136
export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
137137
}
138138

139-
# Stop execution and start a shell. This is useful for debugging tests and
140-
# only makes sense together with "-v".
139+
# Stop execution and start a shell. This is useful for debugging tests.
141140
#
142141
# Be sure to remove all invocations of this command before submitting.
143142

144143
test_pause () {
145-
if test "$verbose" = t; then
146-
"$SHELL_PATH" <&6 >&3 2>&4
147-
else
148-
error >&5 "test_pause requires --verbose"
149-
fi
144+
"$SHELL_PATH" <&6 >&5 2>&7
150145
}
151146

152147
# Wrap git in gdb. Adding this to a command can make it easier to

0 commit comments

Comments
 (0)