diff options
author | Jeff King <peff@peff.net> | 2016-10-22 00:45:06 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-24 09:26:00 -0700 |
commit | 614fe015212d057c0571885c42a29a995973107d (patch) | |
tree | 5a6c27b827b02327eb9e396ccdae678b9752135b /diffcore-break.c | |
parent | travis: use --verbose-log test option (diff) | |
download | tgif-614fe015212d057c0571885c42a29a995973107d.tar.xz |
test-lib: bail out when "-v" used under "prove"
When there is a TAP harness consuming the output of our test
scripts, the "--verbose" breaks the output by mingling
test command output with TAP. Because the TAP::Harness
module used by "prove" is fairly lenient, this _usually_
works, but it violates the spec, and things get very
confusing if the commands happen to output a line that looks
like TAP (e.g., the word "ok" on its own line).
Let's detect this situation and complain. Just calling
error() isn't great, though; prove will tell us that the
script failed, but the message doesn't make it through to
the user. Instead, we can use the special TAP signal "Bail
out!". This not only shows the message to the user, but
instructs the harness to stop running the tests entirely.
This is exactly what we want here, as the problem is in the
command-line options, and every test script would produce
the same error.
The result looks like this (the first "Bailout called" line
is in red if prove uses color on your terminal):
$ make GIT_TEST_OPTS='--verbose --tee'
rm -f -r 'test-results'
*** prove ***
Bailout called. Further testing stopped: verbose mode forbidden under TAP harness; try --verbose-log
FAILED--Further testing stopped: verbose mode forbidden under TAP harness; try --verbose-log
Makefile:39: recipe for target 'prove' failed
make: *** [prove] Error 255
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diffcore-break.c')
0 files changed, 0 insertions, 0 deletions