[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [FYI 1/4] {tap-testsuite-work} test defs: small cleanups and tweakin
From: |
Stefano Lattarini |
Subject: |
Re: [FYI 1/4] {tap-testsuite-work} test defs: small cleanups and tweakings |
Date: |
Mon, 8 Aug 2011 19:03:20 +0200 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
On Monday 08 August 2011, Stefano Lattarini wrote:
> * tests/defs: Where possible, prefer `framework_failure_' or
> `fatal_' to `Exit 99'. Try to catch more possible hard errors
> and setup failures. Do not hide expected error messages. Avoid
> a couple of forks when copying files from `$(top_srcdir)/lib'.
> ($signal): Remove, no more needed.
> ---
> ChangeLog | 9 +++++++++
> tests/defs | 28 +++++++++++++---------------
> 2 files changed, 22 insertions(+), 15 deletions(-)
>
And consider this squashed in, otherwise lesser shells like Solaris 10
/bin/sh might experience spurious faulures.
diff --git a/tests/defs b/tests/defs
index 28b78bc..dc2fee7 100644
--- a/tests/defs
+++ b/tests/defs
@@ -608,7 +608,9 @@ do
priv_check_temp=priv-check.$$
touch $priv_check_temp && chmod a-w $priv_check_temp \
|| framework_failure_ "creating unwritable file $priv_check_temp"
- echo foo >> $priv_check_temp
+ # Not a useless use of subshell: lesser shells like Solaris /bin/sh
+ # can exit if a builtin fails.
+ (echo foo >> $priv_check_temp)
overwrite_status=$?
rm -f $priv_check_temp
if test $overwrite_status -eq 0; then
@@ -635,7 +637,9 @@ do
ro_dir_temp=ro_dir.$$
mkdir $ro_dir_temp && chmod a-w $ro_dir_temp \
|| framework_failure_ "creating unwritable directory $ro_dir_temp"
- : > $ro_dir_temp/probe
+ # Not a useless use of subshell: lesser shells like Solaris /bin/sh
+ # can exit if a builtin fails.
+ (: > $ro_dir_temp/probe)
create_status=$?
rm -rf $ro_dir_temp
if test $create_status -eq 0; then