|
15 | 15 | # You should have received a copy of the GNU General Public License
|
16 | 16 | # along with this program. If not, see http://www.gnu.org/licenses/ .
|
17 | 17 |
|
18 |
| -# if --tee was passed, write the output not only to the terminal, but |
19 |
| -# additionally to the file test-results/$BASENAME.out, too. |
20 |
| -case "$GIT_TEST_TEE_STARTED, $* " in |
21 |
| -done,*) |
22 |
| - # do not redirect again |
23 |
| - ;; |
24 |
| -*' --tee '*|*' --va'*) |
25 |
| - mkdir -p test-results |
26 |
| - BASE=test-results/$(basename "$0" .sh) |
27 |
| - (GIT_TEST_TEE_STARTED=done ${SHELL-sh} "$0" "$@" 2>&1; |
28 |
| - echo $? > $BASE.exit) | tee $BASE.out |
29 |
| - test "$(cat $BASE.exit)" = 0 |
30 |
| - exit |
31 |
| - ;; |
32 |
| -esac |
33 |
| - |
34 | 18 | # Keep the original TERM for say_color
|
35 | 19 | ORIGINAL_TERM=$TERM
|
36 | 20 |
|
|
63 | 47 | . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
|
64 | 48 | export PERL_PATH SHELL_PATH
|
65 | 49 |
|
| 50 | +# if --tee was passed, write the output not only to the terminal, but |
| 51 | +# additionally to the file test-results/$BASENAME.out, too. |
| 52 | +case "$GIT_TEST_TEE_STARTED, $* " in |
| 53 | +done,*) |
| 54 | + # do not redirect again |
| 55 | + ;; |
| 56 | +*' --tee '*|*' --va'*) |
| 57 | + mkdir -p test-results |
| 58 | + BASE=test-results/$(basename "$0" .sh) |
| 59 | + (GIT_TEST_TEE_STARTED=done ${SHELL_PATH} "$0" "$@" 2>&1; |
| 60 | + echo $? > $BASE.exit) | tee $BASE.out |
| 61 | + test "$(cat $BASE.exit)" = 0 |
| 62 | + exit |
| 63 | + ;; |
| 64 | +esac |
| 65 | + |
66 | 66 | # For repeatability, reset the environment to known value.
|
67 | 67 | LANG=C
|
68 | 68 | LC_ALL=C
|
|
0 commit comments