[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[automake-commit] branch master updated: tests: create log file before r
From: |
Karl Berry |
Subject: |
[automake-commit] branch master updated: tests: create log file before running the test script. |
Date: |
Mon, 23 Nov 2020 21:06:13 -0500 |
This is an automated email from the git hooks/post-receive script.
karl pushed a commit to branch master
in repository automake.
View the commit online:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=a5af212ccd20da0ee772709dfc2019c30666bef5
The following commit(s) were added to refs/heads/master by this push:
new a5af212 tests: create log file before running the test script.
a5af212 is described below
commit a5af212ccd20da0ee772709dfc2019c30666bef5
Author: Karl Berry <karl@freefriends.org>
AuthorDate: Mon Nov 23 18:04:56 2020 -0800
tests: create log file before running the test script.
This change partially fixes https://bugs.gnu.org/35762.
* lib/test-driver: create $log_file before running the
test script. Also quote $log_file. Combined suggestions
from howaboutsynergy and Eric Blake.
---
NEWS | 3 +++
lib/test-driver | 9 ++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/NEWS b/NEWS
index ec6915f..df978a5 100644
--- a/NEWS
+++ b/NEWS
@@ -64,6 +64,9 @@
New in ?.?.?:
+* Bugs fixed
+
+ - test-driver less likely to clash with tests writing to the same file.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/lib/test-driver b/lib/test-driver
index 9759384..00c4680 100755
--- a/lib/test-driver
+++ b/lib/test-driver
@@ -105,8 +105,11 @@ trap "st=130; $do_exit" 2
trap "st=141; $do_exit" 13
trap "st=143; $do_exit" 15
-# Test script is run here.
-"$@" >$log_file 2>&1
+# Test script is run here. We create the file first, then append to it,
+# to ameliorate tests themselves also writing to the log file. Our tests
+# don't, but others can (automake bug#35762).
+: >"$log_file"
+"$@" >>"$log_file" 2>&1
estatus=$?
if test $enable_hard_errors = no && test $estatus -eq 99; then
@@ -128,7 +131,7 @@ esac
# know whether the test passed or failed simply by looking at the '.log'
# file, without the need of also peaking into the corresponding '.trs'
# file (automake bug#11814).
-echo "$res $test_name (exit status: $estatus)" >>$log_file
+echo "$res $test_name (exit status: $estatus)" >>"$log_file"
# Report outcome to console.
echo "${col}${res}${std}: $test_name"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [automake-commit] branch master updated: tests: create log file before running the test script.,
Karl Berry <=