Skip to content

Commit f5ba2de

Browse files
peffgitster
authored andcommitted
test-lib: make "-x" work with "--verbose-log"
The "-x" tracing option implies "--verbose". This is a problem when running under a TAP harness like "prove", where we need to use "--verbose-log" instead. Instead, let's handle this the same way we do for --valgrind, including the recent fix from 88c6e9d (test-lib: --valgrind should not override --verbose-log, 2017-09-05). Namely, let's enable --verbose only when we know there isn't a more specific verbosity option indicated. Note that we also have to tweak `want_trace` to turn it on (previously we just lumped $verbose_log in with $verbose, but now we don't necessarily auto-set the latter). Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9be795f commit f5ba2de

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

t/test-lib.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ do
264264
shift ;;
265265
-x)
266266
trace=t
267-
verbose=t
268267
shift ;;
269268
--verbose-log)
270269
verbose_log=t
@@ -283,6 +282,11 @@ then
283282
test -z "$verbose_log" && verbose=t
284283
fi
285284

285+
if test -n "$trace" && test -z "$verbose_log"
286+
then
287+
verbose=t
288+
fi
289+
286290
if test -n "$color"
287291
then
288292
# Save the color control sequences now rather than run tput
@@ -586,7 +590,9 @@ maybe_setup_valgrind () {
586590
}
587591

588592
want_trace () {
589-
test "$trace" = t && test "$verbose" = t
593+
test "$trace" = t && {
594+
test "$verbose" = t || test "$verbose_log" = t
595+
}
590596
}
591597

592598
# This is a separate function because some tests use

0 commit comments

Comments
 (0)