automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Enable `errexit' shell flag in some test scripts.


From: Ralf Wildenhues
Subject: Re: [PATCH] Enable `errexit' shell flag in some test scripts.
Date: Sun, 6 Jun 2010 14:26:23 +0200
User-agent: Mutt/1.5.20 (2009-10-28)

Hi Stefano,

* Stefano Lattarini wrote on Thu, May 06, 2010 at 01:45:10PM CEST:
> Enable the `errexit' shell flag in another bunch of test scripts.
> 
> No relevant semantic change should be introduced by the patch, except 
> for the test `discover.test', which has been made slighty stricter 
> w.r.t. the exit status of Automake (a non-zero exit status is 
> expected) and the grepping of the error message produced by Automake.
> Also, some botched/obsoleted comments and some unnecessary code have 
> been removed from scripts `fonly.test' and `f90only.test'.
> 
> The involved test scripts and the modifications done to them are simple 
> enough that no portability problem involving the `errexit' flag should 
> have been introduced.

Not quite right in this case.  OpenBSD sh fails ext.test with your
patch, see my recent post on autoconf-patches which should improve
the autoconf.texi description of this issue.

> From 66b8cc7b37b38f1c05138ce86b6d7a27f53dc3ad Mon Sep 17 00:00:00 2001
> From: Stefano Lattarini <address@hidden>
> Date: Thu, 6 May 2010 13:37:43 +0200
> Subject: [PATCH] Enable `errexit' shell flag in some test scripts.
> 
> * tests/dash.test: Enable `errexit' shell flag, and related
> changes.
> * tests/defun.test: Likewise.
> * tests/defun2.test: Likewise.
> * tests/dejagnu.test: Likewise.
> * tests/double.test: Likewise.
> * tests/distcom2.test: Likewise.
> * tests/empty2.test: Likewise.
> * tests/empty3.test: Likewise.
> * tests/empty4.test: Likewise.
> * tests/flibs.test: Likewise.
> * tests/exdir.test: Likewise.
> * tests/ext.test: Likewise.
> * tests/extra.test: Likewise.
> * tests/extra2.test: Likewise.
> * tests/extra3.test: Likewise.
> * tests/extra4.test: Likewise.
> * tests/fnoc.test: Likewise.
> * tests/fo.test: Likewise.
> * tests/instexec.test: Likewise.
> * tests/ltdeps.test: Likewise.
> * tests/nodep.test: Likewise.
> * tests/nodepcomp.test: Likewise.
> * tests/f90only.test: Likewise, and remove botched/obsoleted
> comments and unecessary commands.
> * tests/fonly.test: Likewise, and removed botched/obsolted
> comments and unecessary commands.
> * tests/discover.test: Likewise, and made stricter.

I'm committing your patch to maint, re-ordering the log entry so
flibs.test is alphabetical again, and committed the following fix
on top.

Note that to be pedantic, the change of the "&& Exit 1" line is not
necessary when adding the second line (because it's only the last
command inside the compound list that is important), but I prefer to
play safe here; it is not nice to have a test fail just because you
reorder two nearby unrelated commands.

Cheers,
Ralf

    Improve ext.test semantics, avoid OpenBSD sh errexit issue.
    
    * tests/ext.test: Inside shell compound command, use
    `if $cmd; then Exit 1; fi' rather than `$cmd && Exit 1', to
    fix failure with OpenBSD sh introduced with last patch.
    Actually ensure that a rule for .EXT.o is created for each
    known extension EXT.

diff --git a/tests/ext.test b/tests/ext.test
index ef877b0..9340673 100755
--- a/tests/ext.test
+++ b/tests/ext.test
@@ -38,6 +38,7 @@ $AUTOMAKE
 
 for ext in f for f90 f95 F F90 F95 r m upc
 do
-   grep "^$ext\.o:" Makefile.in && Exit 1
+   if grep "^$ext\.o:" Makefile.in; then Exit 1; else :; fi
+   grep "^\.$ext\.o:" Makefile.in
 done
 Exit 0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]