automake-patches
[Top][All Lists]
Advanced

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

Use `set -e' in confsub.test (avoid false negatives).


From: Stefano Lattarini
Subject: Use `set -e' in confsub.test (avoid false negatives).
Date: Tue, 20 Apr 2010 12:22:48 +0200
User-agent: KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.2; i686; ; )

Mmhh... I thought that you had already applied this patch, but 
perusing the git logs of latest master I saw that this is not the 
case.

Thus I rebased the patches and amended them to follow your
suggestions.  The new patches are attached.

Regards,
   Stefano

-*-*-

 PATCH [1/2]  Use `set -e' in confsub.test (avoid false negatives).

  * tests/confsub.test: Enable shell `errexit' flag, and related
    changes (this helps avoiding some possible minor false negatives).
    Also, bumped copyright years.
  
  No portability problems should be introduced, since the test script
  uses mostly simple commands (no shell functions, no shell control
  structures and almost no compound commands); the only exception is
  a compound command whose purpose is to cause the test to fail if
  unexpected text is found in a generated Makefile.in:
    ($FGREP ... subdir/Makefile.in | $FGREP -v ...) && Exit 1
  However, we don't expect this to cause problems, as similar commands
  are already used anyway in test script using the `errexit' flag',
  such as nolink.test:
    grep '^meal.*:' Makefile.in | grep -v beef.meat && Exit 1
  and color.test:
    cat stdout | grep ": pass" | $FGREP "$grn" && Exit 1

-*-*-

 [PATCH 2/2] Some cleanup and cosmetic changes in confsub.test.

  * tests/confsub.test: Prefer `echo' over `cat' to create one-line
    data files, and prefer `:' over `cat' to create empty data files.

-*-*-
From ed36a4a3e9aaa76e3b5751f6431c1c234685808e Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Fri, 9 Apr 2010 18:24:34 +0200
Subject: [PATCH 1/2] Use `set -e' in confsub.test (avoid false negatives).

* tests/confsub.test: Enable shell `errexit' flag, and related
changes (this helps avoiding some possible minor false negatives).
Also, bumped copyright years.
---
 ChangeLog          |    7 +++++++
 tests/confsub.test |    8 ++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a026c84..e9597c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-04-20  Stefano Lattarini  <address@hidden>
+
+       Use `set -e' in confsub.test (avoids possible false negatives).
+       * tests/confsub.test: Enable shell `errexit' flag, and related
+       changes (this helps avoiding some possible minor false negatives).
+       Also, bumped copyright years.
+
 2010-04-20  Ralf Wildenhues  <address@hidden>
 
        Fix -Werror handling for presence of configure.in and configure.ac.
diff --git a/tests/confsub.test b/tests/confsub.test
index 40c90c5..65ec91b 100755
--- a/tests/confsub.test
+++ b/tests/confsub.test
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2010 Free
+# Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,6 +20,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat > configure.in << 'END'
 AC_INIT
 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
@@ -55,5 +57,3 @@ $sleep
 echo 'After.' > subdir/config.hin
 $MAKE || Exit 1
 $FGREP 'After.' subdir/config.h || Exit 1
-
-Exit 0
-- 
1.6.5

From 257383025b34cf12789245b158a430da21062180 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Fri, 9 Apr 2010 18:43:22 +0200
Subject: [PATCH 2/2] Some cleanup and cosmetic changes in confsub.test.

* tests/confsub.test: Prefer `echo' over `cat' to create one-line
data files, and prefer `:' over `cat' to create empty data files.
---
 ChangeLog          |    4 ++++
 tests/confsub.test |    7 ++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e9597c5..51eb850 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-04-20  Stefano Lattarini  <address@hidden>
 
+       Some cleanup and cosmetic changes in confsub.test.
+       * tests/confsub.test: Prefer `echo' over `cat' to create one-line
+       data files, and prefer `:' over `cat' to create empty data files.
+
        Use `set -e' in confsub.test (avoids possible false negatives).
        * tests/confsub.test: Enable shell `errexit' flag, and related
        changes (this helps avoiding some possible minor false negatives).
diff --git a/tests/confsub.test b/tests/confsub.test
index 65ec91b..b50999b 100755
--- a/tests/confsub.test
+++ b/tests/confsub.test
@@ -29,13 +29,10 @@ AM_CONFIG_HEADER(subdir/config.h:subdir/config.hin)
 AC_OUTPUT(Makefile subdir/Makefile)
 END
 
-cat > Makefile.am << 'END'
-SUBDIRS = subdir
-END
+echo 'SUBDIRS = subdir' > Makefile.am
 
 mkdir subdir
-cat > subdir/Makefile.am << 'END'
-END
+: > subdir/Makefile.am
 
 echo 'Before.' > subdir/config.hin
 
-- 
1.6.5


reply via email to

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