test-lib: --valgrind should not override --verbose-log
authorJeff King <peff@peff.net>
Tue, 5 Sep 2017 13:03:54 +0000 (09:03 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Sep 2017 09:06:26 +0000 (18:06 +0900)
The --verbose test option cannot be used with test harnesses
like "prove". Instead, you must use --verbose-log.

Since the --valgrind option implies --verbose, that means
that it cannot be used with prove. I.e., this does not work:

prove t0000-basic.sh :: --valgrind

You'd think it could be fixed by doing:

prove t0000-basic.sh :: --valgrind --verbose-log

but that doesn't work either, because the implied --verbose
takes precedence over --verbose-log. If the user has given
us a specific option, we should prefer that.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh
index 5fbd8d4a90b3b88cf57ca53c6b1fe99d5a957460..62461a6e350fa6aad4ce2d776d21044d1d20d1a3 100644 (file)
@@ -274,7 +274,7 @@ then
        test -z "$verbose" && verbose_only="$valgrind_only"
 elif test -n "$valgrind"
 then
-       verbose=t
+       test -z "$verbose_log" && verbose=t
 fi
 
 if test -n "$color"