diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2009-02-04 00:26:12 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-02-03 22:01:09 -0800 |
commit | 44138559e8b7c89768a2450220b831847059311c (patch) | |
tree | 2ba465a4b1fe144d5c3a7057bdb856b35f0543a7 /t/README | |
parent | efd92ffd316d03360e1c8a348091e4f50f749d6f (diff) | |
download | git-44138559e8b7c89768a2450220b831847059311c.tar.gz |
test-lib.sh: optionally output to test-results/$TEST.out, too
When tests are run in parallel and a few tests fail, it does not help
that the output of the terminal is totally confusing, as you rarely know
which test which line came from.
So introduce the option '--tee' which triggers that the output of the
tests will be written to t/test-results/$TEST.out in addition to the
terminal, where $TEST is the basename of the script.
Unfortunately, there seems to be no way to redirect a given file
descriptor to a specified subprocess in POSIX shell, only redirection
to a file is supported via 'exec > $FILE'.
At least with bash, one might think that 'exec >($COMMAND)' would work
as intended, but it does not.
The common way to work around the lack of proper tools support is to
work with named pipes, alas, one of our most beloved platforms does not
really support named pipes. Besides, we would need a pipe for every
script, as the whole point of this patch is to allow parallel execution.
Therefore, we handle the redirection in the following way: when '--tee'
was passed to the test script, the variable GIT_TEST_TEE_STARTED is set
(to avoid triggering that code path again) and the script is started
_again_, in a subshell, redirected to the command "tee".
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/README')
-rw-r--r-- | t/README | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -65,6 +65,12 @@ appropriately before running "make". the test script when running under -i). Valgrind errors go to stderr, so you might want to pass the -v option, too. +--tee:: + In addition to printing the test output to the terminal, + write it to files named 't/test-results/$TEST_NAME.out'. + As the names depend on the tests' file names, it is safe to + run the tests with this option in parallel. + Skipping Tests -------------- |