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>
This commit is contained in:
parent
dabdbee10b
commit
c54e6be75a
@ -575,7 +575,7 @@ test_external () {
|
|||||||
test_external_without_stderr () {
|
test_external_without_stderr () {
|
||||||
# The temporary file has no (and must have no) security
|
# The temporary file has no (and must have no) security
|
||||||
# implications.
|
# implications.
|
||||||
tmp="$TMPDIR"; if [ -z "$tmp" ]; then tmp=/tmp; fi
|
tmp=${TMPDIR:-/tmp}
|
||||||
stderr="$tmp/git-external-stderr.$$.tmp"
|
stderr="$tmp/git-external-stderr.$$.tmp"
|
||||||
test_external "$@" 4> "$stderr"
|
test_external "$@" 4> "$stderr"
|
||||||
[ -f "$stderr" ] || error "Internal error: $stderr disappeared."
|
[ -f "$stderr" ] || error "Internal error: $stderr disappeared."
|
||||||
@ -801,12 +801,14 @@ test_done () {
|
|||||||
mkdir -p "$test_results_dir"
|
mkdir -p "$test_results_dir"
|
||||||
test_results_path="$test_results_dir/${0%.sh}-$$.counts"
|
test_results_path="$test_results_dir/${0%.sh}-$$.counts"
|
||||||
|
|
||||||
echo "total $test_count" >> $test_results_path
|
cat >>"$test_results_path" <<-EOF
|
||||||
echo "success $test_success" >> $test_results_path
|
total $test_count
|
||||||
echo "fixed $test_fixed" >> $test_results_path
|
success $test_success
|
||||||
echo "broken $test_broken" >> $test_results_path
|
fixed $test_fixed
|
||||||
echo "failed $test_failure" >> $test_results_path
|
broken $test_broken
|
||||||
echo "" >> $test_results_path
|
failed $test_failure
|
||||||
|
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$test_fixed" != 0
|
if test "$test_fixed" != 0
|
||||||
|
Loading…
Reference in New Issue
Block a user