Skip to content

Commit 9304052

Browse files
committed
Merge branch 'sg/test-with-stdin' into maint
Teach the "debug" helper used in the test framework that allows a command to run under "gdb" to make the session interactive. * sg/test-with-stdin: tests: make the 'test_pause' helper work in non-verbose mode tests: create an interactive gdb session with the 'debug' helper
2 parents c34aa34 + 59210dd commit 9304052

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

t/test-lib-functions.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,25 +136,20 @@ 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
153148
# understand what is going on in a failing test.
154149
#
155150
# Example: "debug git checkout master".
156151
debug () {
157-
GIT_TEST_GDB=1 "$@"
152+
GIT_TEST_GDB=1 "$@" <&6 >&5 2>&7
158153
}
159154

160155
# Call test_commit with the arguments

t/test-lib.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ fi
342342

343343
exec 5>&1
344344
exec 6<&0
345+
exec 7>&2
345346
if test "$verbose_log" = "t"
346347
then
347348
exec 3>>"$GIT_TEST_TEE_OUTPUT_FILE" 4>&3

0 commit comments

Comments
 (0)