diff options
author | Mathias Lafeldt <misfire@debugon.org> | 2011-04-29 16:30:30 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-04-29 19:27:52 +0400 |
commit | c54e6be75ae90e2be45c32f4d1949fff59ad7d9d (patch) | |
tree | 834a0e6a64595cc9c5f209816c097755d3e33d3e /t/test-lib.sh | |
parent | dabdbee10bd6c7d92204ce4bfc1f3ffd60a4046a (diff) |
t/test-lib.sh: minor readability improvements
Apply parameter expansion. Also use here document to save
test results instead of appending each line with ">>".
Signed-off-by: Mathias Lafeldt <misfire@debugon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r-- | t/test-lib.sh | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index abc47f3abc..aca03d2db0 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -575,7 +575,7 @@ test_external () { test_external_without_stderr () { # The temporary file has no (and must have no) security # implications. - tmp="$TMPDIR"; if [ -z "$tmp" ]; then tmp=/tmp; fi + tmp=${TMPDIR:-/tmp} stderr="$tmp/git-external-stderr.$$.tmp" test_external "$@" 4> "$stderr" [ -f "$stderr" ] || error "Internal error: $stderr disappeared." @@ -801,12 +801,14 @@ test_done () { mkdir -p "$test_results_dir" test_results_path="$test_results_dir/${0%.sh}-$$.counts" - echo "total $test_count" >> $test_results_path - echo "success $test_success" >> $test_results_path - echo "fixed $test_fixed" >> $test_results_path - echo "broken $test_broken" >> $test_results_path - echo "failed $test_failure" >> $test_results_path - echo "" >> $test_results_path + cat >>"$test_results_path" <<-EOF + total $test_count + success $test_success + fixed $test_fixed + broken $test_broken + failed $test_failure + + EOF fi if test "$test_fixed" != 0 |