[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Enable `set -e' in more tests (plus some tweakings).
From: |
Stefano Lattarini |
Subject: |
[PATCH] Enable `set -e' in more tests (plus some tweakings). |
Date: |
Sun, 22 Aug 2010 15:10:54 +0200 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
Another patch enabling a more widespread use of the `errexit' shell
flag in test scripts. This one does most of the tests from `a' to
`l'.
This patch shouldn't cause problems, as the modified tests do not use
shell functions nor complex shell constructs, loops or conditionals
(with the exception of `info.test', but see the "FIXME" comment added
to it).
OK for maint?
Regards,
Stefano
From 9dd345252eeb080ac8770a151fb1a0e9542383e7 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Fri, 20 Aug 2010 19:53:38 +0200
Subject: [PATCH] Enable `set -e' in more tests (plus some tweakings).
* tests/implicit.test: Enable `errexit' shell flag, and related
changes. Add trailing `:' command.
* tests/insh2.test: Likewise.
* tests/instman2.test: Likewise.
* tests/interp.test: Likewise.
* tests/interp2.test: Likewise.
* tests/library.test: Likewise.
* tests/mclean.test: Likewise.
* tests/libobj4.test: Likewise.
* tests/libobj5.test: Likewise, and make more robust by using
longer filenames to grep.
* tests/info.test: Enable `errexit' shell flag, and related
changes. Add trailing `:' command. Remove useless chaff from
generated Makefile.am. Add a "FIXME" comment.
* tests/include.test: Enable `errexit' shell flag, and related
changes. Add trailing `:' command. Prefer cat + here-doc over
echo to append to configure.in. Make tests more robust by using
longer and less common names to grep. Remove an useless call to
echo. Remove an useless subshell.
* tests/header.test: Enable `errexit' shell flag, and related
changes. Use proper m4 quoting. Add excerpts from the original
report of the bug tested for by this script.
* tests/gcj.test: Enable `errexit' shell flag, and related
changes. Use proper m4 quoting. Add trailing `:' command.
* tests/gcj3.test: Likewise.
* tests/ldflags.test: Likewise.
* tests/libtool.test: Likewise.
* tests/listval.test: Likewise.
* tests/ltlibobjs.test: Likewise.
* tests/javaprim.test: Likewise, and prefer cat + here-doc over
echo to append to configure.in.
* tests/javasubst.test: Likewise.
* tests/discorver.test: Enable `errexit' shell flag. Prefer
trailing `:' over trailing `Exit 0'.
* tests/instdat.test: Enable `errexit' shell flag, and related
changes. Use proper m4 quoting. Avoid usless subshell. Prefer
cat + here-doc over echo to append to configure.in.
* tests/libobj7.test: Enable `errexit' shell flag, and related
changes. Add trailing `:' command. Use the configure.in
stub provided by ./defs, rather than writing it from scratch.
* tests/libtool2.test: Likewise.
* tests/libobj8.test: Likewise.
* tests/libobj2.test: Likewise. Also, add calls to autoconf,
./configure and make, to ensure everything really works.
* tests/libobj11.test: Likewise.
---
ChangeLog | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
tests/discover.test | 4 +++-
tests/gcj.test | 14 +++++++++-----
tests/gcj3.test | 14 +++++++++-----
tests/header.test | 17 +++++++++++++----
tests/implicit.test | 10 +++++++---
tests/include.test | 28 +++++++++++++++++-----------
tests/info.test | 16 ++++++++++------
tests/insh2.test | 12 ++++++++----
tests/instdat.test | 14 +++++++++-----
tests/instman2.test | 10 +++++++---
tests/interp.test | 10 +++++++---
tests/interp2.test | 8 ++++++--
tests/javaprim.test | 12 +++++++++---
tests/javasubst.test | 14 ++++++++++----
tests/ldflags.test | 11 ++++++++---
tests/libobj11.test | 30 ++++++++++++++++++++++--------
tests/libobj2.test | 37 +++++++++++++++++++++++++++----------
tests/libobj4.test | 10 +++++++---
tests/libobj5.test | 16 ++++++++++------
tests/libobj7.test | 17 ++++++++++-------
tests/libobj8.test | 19 +++++++++++--------
tests/library.test | 9 +++++++--
tests/libtool.test | 13 +++++++++----
tests/libtool2.test | 20 +++++++++-----------
tests/listval.test | 11 ++++++++---
tests/ltlibobjs.test | 11 ++++++++---
tests/mclean.test | 10 +++++++---
28 files changed, 316 insertions(+), 130 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 934eba6..6eb7733 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,52 @@
+2010-08-22 Stefano Lattarini <address@hidden>
+
+ Enable `set -e' in more tests (plus some tweakings).
+ * tests/implicit.test: Enable `errexit' shell flag, and related
+ changes. Add trailing `:' command.
+ * tests/insh2.test: Likewise.
+ * tests/instman2.test: Likewise.
+ * tests/interp.test: Likewise.
+ * tests/interp2.test: Likewise.
+ * tests/library.test: Likewise.
+ * tests/mclean.test: Likewise.
+ * tests/libobj4.test: Likewise.
+ * tests/libobj5.test: Likewise, and make more robust by using
+ longer filenames to grep.
+ * tests/info.test: Enable `errexit' shell flag, and related
+ changes. Add trailing `:' command. Remove useless chaff from
+ generated Makefile.am. Add a "FIXME" comment.
+ * tests/include.test: Enable `errexit' shell flag, and related
+ changes. Add trailing `:' command. Prefer cat + here-doc over
+ echo to append to configure.in. Make tests more robust by using
+ longer and less common names to grep. Remove an useless call to
+ echo. Remove an useless subshell.
+ * tests/header.test: Enable `errexit' shell flag, and related
+ changes. Use proper m4 quoting. Add excerpts from the original
+ report of the bug tested for by this script.
+ * tests/gcj.test: Enable `errexit' shell flag, and related
+ changes. Use proper m4 quoting. Add trailing `:' command.
+ * tests/gcj3.test: Likewise.
+ * tests/ldflags.test: Likewise.
+ * tests/libtool.test: Likewise.
+ * tests/listval.test: Likewise.
+ * tests/ltlibobjs.test: Likewise.
+ * tests/javaprim.test: Likewise, and prefer cat + here-doc over
+ echo to append to configure.in.
+ * tests/javasubst.test: Likewise.
+ * tests/discorver.test: Enable `errexit' shell flag. Prefer
+ trailing `:' over trailing `Exit 0'.
+ * tests/instdat.test: Enable `errexit' shell flag, and related
+ changes. Use proper m4 quoting. Avoid usless subshell. Prefer
+ cat + here-doc over echo to append to configure.in.
+ * tests/libobj7.test: Enable `errexit' shell flag, and related
+ changes. Add trailing `:' command. Use the configure.in
+ stub provided by ./defs, rather than writing it from scratch.
+ * tests/libtool2.test: Likewise.
+ * tests/libobj8.test: Likewise.
+ * tests/libobj2.test: Likewise. Also, add calls to autoconf,
+ ./configure and make, to ensure everything really works.
+ * tests/libobj11.test: Likewise.
+
2010-08-18 Stefano Lattarini <address@hidden>
Fix potential regressions in depcomp{3,5}.test.
diff --git a/tests/discover.test b/tests/discover.test
index 0e4faa3..f319604 100755
--- a/tests/discover.test
+++ b/tests/discover.test
@@ -19,6 +19,8 @@
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_RANLIB
AC_PROG_CC
@@ -39,4 +41,4 @@ AUTOMAKE_fails
grep 'automatically discovered.*fsusage\.c.*explicitly mentioned' stderr
-Exit 0
+:
diff --git a/tests/gcj.test b/tests/gcj.test
index c32a1b2..b9819dd 100755
--- a/tests/gcj.test
+++ b/tests/gcj.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 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
@@ -18,9 +18,11 @@
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
-_AM_DEPENDENCIES(GCJ)
-AC_SUBST(GCJ)
+_AM_DEPENDENCIES([GCJ])
+AC_SUBST([GCJ])
END
cat > Makefile.am << 'END'
@@ -28,7 +30,9 @@ bin_PROGRAMS = convert
convert_SOURCES = x/y/convert.java
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
grep '^x/y/convert' Makefile.in
+
+:
diff --git a/tests/gcj3.test b/tests/gcj3.test
index 7d8a981..5652124 100755
--- a/tests/gcj3.test
+++ b/tests/gcj3.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 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
@@ -18,9 +18,11 @@
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
-_AM_DEPENDENCIES(GCJ)
-AC_SUBST(GCJ)
+_AM_DEPENDENCIES([GCJ])
+AC_SUBST([GCJ])
END
cat > Makefile.am << 'END'
@@ -28,8 +30,10 @@ bin_PROGRAMS = convert
convert_SOURCES = x/y/convert.java
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
num=`grep depcomp Makefile.in | wc -l`
test $num -gt 1
+
+:
diff --git a/tests/header.test b/tests/header.test
index 2ad2735..bd06b16 100755
--- a/tests/header.test
+++ b/tests/header.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 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
@@ -15,11 +15,20 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test for PR 68.
+#
+# == Report ==
+# If an autoconf substitution variable of the form "*_HEADERS" --
+# for example "MY_HEADERS" -- is used in an "include_" variable
+# in conjunction with EXTRA_HEADERS, $(MY_HEADERS) gets included
+# in the HEADERS variable for *all* generated Makefile.ins in the
+# project.
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
-AC_SUBST(MY_HEADERS)
+AC_SUBST([MY_HEADERS])
AC_PROG_CC
END
@@ -31,8 +40,8 @@ END
: > joe.c
: > qq.h
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
grep 'address@hidden' Makefile.in && Exit 1
Exit 0
diff --git a/tests/implicit.test b/tests/implicit.test
index 210b2dc..c1c3479 100755
--- a/tests/implicit.test
+++ b/tests/implicit.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 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
@@ -19,6 +19,8 @@
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
END
@@ -27,7 +29,9 @@ cat > Makefile.am << 'END'
noinst_PROGRAMS = libapp_1
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
grep '^libapp_1_OBJECTS' Makefile.in | $FGREP '.$(OBJEXT)'
+
+:
diff --git a/tests/include.test b/tests/include.test
index 350f8fc..180b025 100755
--- a/tests/include.test
+++ b/tests/include.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2005, 2006, 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
@@ -19,22 +20,25 @@
. ./defs || Exit 1
-echo AC_OUTPUT >> configure.in
+set -e
+
+cat >> configure.in <<END
+AC_OUTPUT
+END
cat > Makefile.am << 'END'
-include foo
+include Will_Be_Included_In_Makefile
END
-: > foo
+: > Will_Be_Included_In_Makefile
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-len="`grep '^srcdir' Makefile.in | wc -l`"
-echo "len = $len"
-test $len -eq 1 || Exit 1
+$ACLOCAL
+$AUTOMAKE
+len=`grep '^srcdir' Makefile.in | wc -l`
+test $len -eq 1
# Also make sure include file is distributed.
-(sed -n -e '/^DIST_COMMON =.*\\$/ {
+sed -n -e '/^DIST_COMMON =.*\\$/ {
:loop
p
n
@@ -44,4 +48,6 @@ test $len -eq 1 || Exit 1
t loop
p
n
- }' -e '/^DIST_COMMON =/ p' Makefile.in | grep foo)
+ }' -e '/^DIST_COMMON =/ p' Makefile.in | grep Will_Be_Included_In_Makefile
+
+:
diff --git a/tests/info.test b/tests/info.test
index 2cde524..e99a187 100755
--- a/tests/info.test
+++ b/tests/info.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 2001, 2002, 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
@@ -15,21 +16,22 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test to make sure info files are distributed correctly.
+# FIXME: This test is probably obsoleted, or wrong. The generated
+# Makefile.in seems not to define any `INFOS' variable!
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
info_TEXINFOS = foo.texi
-
-magic:
- @echo $(INFOS)
END
echo '@setfilename foo.info' > foo.texi
: > texinfo.tex
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
for i in `grep '^INFOS =' Makefile.in | sed -e 's/^INFOS = //'`; do
echo $i
@@ -41,3 +43,5 @@ for i in `grep '^INFOS =' Makefile.in | sed -e 's/^INFOS =
//'`; do
;;
esac
done
+
+:
diff --git a/tests/insh2.test b/tests/insh2.test
index c64f1f7..c3da9a9 100755
--- a/tests/insh2.test
+++ b/tests/insh2.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
@@ -19,14 +19,18 @@
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
pkgdata_DATA =
magic:
@echo $(DISTFILES)
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
$FGREP -v @SET_MAKE@ Makefile.in > Makefile.sed
$MAKE -s -f Makefile.sed SHELL=$SHELL magic | grep install-sh
+
+:
diff --git a/tests/instdat.test b/tests/instdat.test
index a6ec01a..d5b4d07 100755
--- a/tests/instdat.test
+++ b/tests/instdat.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 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
@@ -19,12 +19,16 @@
. ./defs || Exit 1
-echo 'AC_SUBST(INSTALL_DATA)' >> configure.in
+set -e
+
+cat >> configure.in <<END
+AC_SUBST([INSTALL_DATA])
+END
: > Makefile.am
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
-(grep '^DATA =' Makefile.in | grep INSTALL_DATA) && Exit 1
+grep '^DATA =' Makefile.in | grep 'INSTALL_DATA' && Exit 1
Exit 0
diff --git a/tests/instman2.test b/tests/instman2.test
index 77844fa..c519214 100755
--- a/tests/instman2.test
+++ b/tests/instman2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 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
@@ -19,13 +19,17 @@
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'EOF'
man8_MANS = frob.8
EOF
: > frob.8
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
grep '^install-man' Makefile.in
+
+:
diff --git a/tests/interp.test b/tests/interp.test
index af82e33..82938f9 100755
--- a/tests/interp.test
+++ b/tests/interp.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 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
@@ -18,6 +18,8 @@
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
END
@@ -28,7 +30,9 @@ s1 = z.c
qqq_SOURCES = $(s1)
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
$FGREP 'z.$(OBJEXT)' Makefile.in
+
+:
diff --git a/tests/interp2.test b/tests/interp2.test
index cff8d1d..a25d531 100755
--- a/tests/interp2.test
+++ b/tests/interp2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 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
@@ -19,6 +19,8 @@
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PATH_X
@@ -31,5 +33,7 @@ x_SOURCES = x.c
x_LDADD = $(X_EXTRA_LIBS)
END
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE
+
+:
diff --git a/tests/javaprim.test b/tests/javaprim.test
index aa1506b..988024d 100755
--- a/tests/javaprim.test
+++ b/tests/javaprim.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 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
@@ -18,12 +18,18 @@
. ./defs || Exit 1
-echo 'AC_SUBST(JAVA)' >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AC_SUBST([JAVA])
+END
cat > Makefile.am << 'END'
javadir = $(datadir)/java
java_JAVA = a.java b.java c.java
END
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE
+
+:
diff --git a/tests/javasubst.test b/tests/javasubst.test
index d018645..ae6bb78 100755
--- a/tests/javasubst.test
+++ b/tests/javasubst.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 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
@@ -18,14 +18,20 @@
. ./defs || Exit 1
-echo 'AC_SUBST(JAVAC)' >> configure.in
+set -e
+
+cat >> configure.in << 'END'
+AC_SUBST([JAVAC])
+END
cat > Makefile.am << 'END'
javadir = $(datadir)/java
java_JAVA = a.java b.java c.java
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
grep 'address@hidden@' Makefile.in
+
+:
diff --git a/tests/ldflags.test b/tests/ldflags.test
index 39ca274..d078eaa 100755
--- a/tests/ldflags.test
+++ b/tests/ldflags.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 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
@@ -16,14 +16,17 @@
# Check for LDFLAGS in conditional.
# PR 77.
+
required=libtool
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_LIBTOOL
AC_SUBST([LTLIBOBJS], [q.o])
-AM_CONDITIONAL(USE_SWIG, :)
+AM_CONDITIONAL([USE_SWIG], [:])
AC_OUTPUT
END
@@ -41,5 +44,7 @@ END
: > config.sub
: > q.c
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE
+
+:
diff --git a/tests/libobj11.test b/tests/libobj11.test
index 204ff8b..b85e7fb 100755
--- a/tests/libobj11.test
+++ b/tests/libobj11.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2002, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2008, 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
@@ -18,22 +18,36 @@
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_RANLIB
AC_LIBOBJ([mountlist])
-AC_OUTPUT(Makefile)
+AC_OUTPUT
END
cat > Makefile.am << 'END'
+check-local:
+ test -f libtu.a
noinst_LIBRARIES = libtu.a
libtu_a_SOURCES =
libtu_a_LIBADD = @LIBOBJS@
END
-: > mountlist.c
+cat > mountlist.c << 'END'
+extern int dummy;
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+$FGREP 'mountlist.c' Makefile.in
+
+./configure
+
+$MAKE check
+$MAKE distcheck
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+:
diff --git a/tests/libobj2.test b/tests/libobj2.test
index 81b0e72..9d6bd9f 100755
--- a/tests/libobj2.test
+++ b/tests/libobj2.test
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 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,13 +20,20 @@
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([subdir/Makefile])
AC_PROG_CC
AC_PROG_RANLIB
AC_LIBOBJ([fsusage])
-AC_OUTPUT(subdir/Makefile)
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = subdir
+check-local:
+ test -f subdir/libtu.a
END
mkdir subdir
@@ -37,9 +44,19 @@ libtu_a_SOURCES =
libtu_a_LIBADD = @LIBOBJS@
END
-: > subdir/fsusage.c
+cat > subdir/fsusage.c << 'END'
+extern int dummy;
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+$FGREP 'fsusage.c' subdir/Makefile.in
+
+./configure
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$MAKE check
+$MAKE distcheck
-grep 'fsusage\.c' subdir/Makefile.in
+:
diff --git a/tests/libobj4.test b/tests/libobj4.test
index d6639be..d31e5ff 100755
--- a/tests/libobj4.test
+++ b/tests/libobj4.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 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
@@ -19,14 +19,18 @@
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
bin_PROGRAMS = foo
END
cat >> configure.in << 'END'
AC_PROG_CC
-AC_REPLACE_FUNCS(foo)
+AC_REPLACE_FUNCS([foo])
END
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE
+
+:
diff --git a/tests/libobj5.test b/tests/libobj5.test
index 6add9e3..7aa218a 100755
--- a/tests/libobj5.test
+++ b/tests/libobj5.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 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
@@ -19,6 +19,8 @@
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
bin_PROGRAMS = joe
LDADD = @LIBOBJS@
@@ -27,11 +29,13 @@ END
cat >> configure.in << 'END'
AC_PROG_CC
AC_REPLACE_FUNCS(\
- foo)
+ foo_bar_quux)
END
-: > foo.c
+: > foo_bar_quux.c
+
+$ACLOCAL
+$AUTOMAKE
+$FGREP foo_bar_quux.c Makefile.in
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-$FGREP foo.c Makefile.in
+:
diff --git a/tests/libobj7.test b/tests/libobj7.test
index 73a8ab0..9b5f67d 100755
--- a/tests/libobj7.test
+++ b/tests/libobj7.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 2000, 2001, 2002, 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
@@ -18,13 +19,13 @@
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_RANLIB
AC_REPLACE_FUNCS(basename dirname strsignal)
-AC_OUTPUT(Makefile)
+AC_OUTPUT
END
cat > Makefile.am << 'END'
@@ -37,8 +38,8 @@ END
: > dirname.c
: > strsignal.c
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
sed -n -e ': again
/^DIST_COMMON.*[^\]$/ p
@@ -48,3 +49,5 @@ sed -n -e ': again
s/^/DIST_COMMON/
b again
}' < Makefile.in | $FGREP dirname.c
+
+:
diff --git a/tests/libobj8.test b/tests/libobj8.test
index c06746b..95f21ed 100755
--- a/tests/libobj8.test
+++ b/tests/libobj8.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1998, 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2000, 2001, 2002, 2006, 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
@@ -19,15 +20,15 @@
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_CC_STDC
AC_PROG_RANLIB
AC_REPLACE_FUNCS(basename dirname strsignal)
AM_C_PROTOTYPES
-AC_OUTPUT(Makefile)
+AC_OUTPUT
END
cat > Makefile.am << 'END'
@@ -44,7 +45,9 @@ END
: > ansi2knr.1
: > ansi2knr.c
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+$FGREP 'strsignal_.c:' Makefile.in
-grep 'strsignal_.c:' Makefile.in
+:
diff --git a/tests/library.test b/tests/library.test
index 1e2b58b..b35e883 100755
--- a/tests/library.test
+++ b/tests/library.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2008 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2008, 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
@@ -18,6 +19,8 @@
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_RANLIB
AM_MAINTAINER_MODE
@@ -30,5 +33,7 @@ lib_LIBRARIES = libfoo.a
libfoo_a_DEPENDENCIES = libzot.a
END
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE
+
+:
diff --git a/tests/libtool.test b/tests/libtool.test
index dd2a939..a75eada 100755
--- a/tests/libtool.test
+++ b/tests/libtool.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 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
@@ -16,14 +16,17 @@
# Make sure libtool is removed.
# Report from Kevin Dalley
+
required=libtool
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_LIBTOOL_DLOPEN
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
-AC_SUBST(LIBTOOL_DEPS)
+AC_SUBST([LIBTOOL_DEPS])
END
: > Makefile.am
@@ -32,7 +35,9 @@ END
: > config.guess
: > config.sub
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
grep 'rm -f libtool' Makefile.in
+
+:
diff --git a/tests/libtool2.test b/tests/libtool2.test
index a50f6a4..e4ea89e 100755
--- a/tests/libtool2.test
+++ b/tests/libtool2.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 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
@@ -16,20 +16,16 @@
# Make sure libtool clean targets exist.
# Report from Eric Magnien.
+
required=libtoolize
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(mypackage,0.1)
+set -e
+cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_LIBTOOL
-
-AC_CONFIG_FILES([
- sub/Makefile
- Makefile
-])
+AC_CONFIG_FILES([sub/Makefile])
AC_OUTPUT
END
@@ -45,8 +41,10 @@ lib_LTLIBRARIES = libfoo.la
libfoo_la_SOURCES = foo.c
END
-$ACLOCAL || Exit 1
+$ACLOCAL
: > ltmain.sh
-$AUTOMAKE -a || Exit 1
+$AUTOMAKE -a
grep 'rm -f .*\.lo' sub/Makefile.in
+
+:
diff --git a/tests/listval.test b/tests/listval.test
index 5ff75db..5a71a05 100755
--- a/tests/listval.test
+++ b/tests/listval.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -16,11 +16,14 @@
# Test to make sure variable is expanded properly.
# From Adam J. Richter.
+
required=libtool
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
-AC_SUBST(LTLIBOBJS)
+AC_SUBST([LTLIBOBJS])
AC_PROG_LIBTOOL
END
@@ -37,5 +40,7 @@ END
: > config.guess
: > config.sub
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE
+
+:
diff --git a/tests/ltlibobjs.test b/tests/ltlibobjs.test
index fd66473..7d46a93 100755
--- a/tests/ltlibobjs.test
+++ b/tests/ltlibobjs.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 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
@@ -16,11 +16,14 @@
# Test to make sure LTLIBOBJS alone works ok.
# Report from Vadim Zeitlin.
+
required=libtool
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
-AC_SUBST(LTLIBOBJS)
+AC_SUBST([LTLIBOBJS])
AC_PROG_LIBTOOL
END
@@ -35,5 +38,7 @@ END
: > config.guess
: > config.sub
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE
+
+:
diff --git a/tests/mclean.test b/tests/mclean.test
index dcbe818..331b3d7 100755
--- a/tests/mclean.test
+++ b/tests/mclean.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 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
@@ -19,13 +19,17 @@
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
MAINTAINERCLEANFILES = foo
END
: > FOO
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
grep 'rm -f .*MAINTAINERCLEANFILES' Makefile.in
+
+:
--
1.7.1
- [PATCH] Enable `set -e' in more tests (plus some tweakings).,
Stefano Lattarini <=