From: Mathias Lafeldt <misfire@debugon.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH v2] t/test-lib.sh: minor readability improvements
Date: Fri, 29 Apr 2011 14:30:30 +0200 [thread overview]
Message-ID: <1304080230-11670-1-git-send-email-misfire@debugon.org> (raw)
In-Reply-To: <4DBA8C43.4040804@debugon.org>
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>
---
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 abc47f3..aca03d2 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
--
1.7.5
next prev parent reply other threads:[~2011-04-29 12:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 12:49 [PATCH] t/test-lib.sh: minor readability improvements Mathias Lafeldt
2011-04-27 17:28 ` Junio C Hamano
2011-04-29 10:00 ` Mathias Lafeldt
2011-04-29 12:30 ` Mathias Lafeldt [this message]
2011-04-29 16:28 ` [PATCH v2] " Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1304080230-11670-1-git-send-email-misfire@debugon.org \
--to=misfire@debugon.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).