]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Enable `errexit' shell flag in various tests.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 11 Jun 2010 15:19:20 +0000 (17:19 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 12 Jun 2010 10:26:20 +0000 (12:26 +0200)
* tests/backsl.test: Enable the `errexit' shell flag, and
related changes.
* tests/backsl2.test: Likewise.
* tests/block.test: Likewise.
* tests/canon2.test: Likewise.
* tests/canon4.test: Likewise.
* tests/comment2.test: Likewise.
* tests/condlib.test: Likewise.
* tests/cond15.test: Likewise, and prefer $FGREP over grep.
* tests/canon3.test: Likewise.  Also, avoid to create an useless
dummy source file.
* tests/acoutpt2.test: Enable the `errexit' shell flag, and some
related changes.  Do some cosmetic improvements in the generated
`configure.in' file.
* tests/cond4.test: Likewise.
* tests/cond14.test: Likewise.
* tests/condinc.test: Likewise.
* tests/cond7.test: Likewise.  Also, remove useless setting of
AUTOMAKE_OPTIONS to `foreign' in the generated Makefile.am.
* tests/ansi.test: Enable the `errexit' shell flag, and related
changes.  Extended, esp. by running autoconf, ./configure and
make, and by looking into the distdir.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
16 files changed:
ChangeLog
tests/acoutpt2.test
tests/ansi.test
tests/backsl.test
tests/backsl2.test
tests/block.test
tests/canon2.test
tests/canon3.test
tests/canon4.test
tests/comment2.test
tests/cond14.test
tests/cond15.test
tests/cond4.test
tests/cond7.test
tests/condinc.test
tests/condlib.test

index 3c25fb92e5b789f2b7e026d32d5942f46e760428..6f6ca10a7a9d182b2dfb7267bc8c53033ba395b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2010-06-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Enable `errexit' shell flag in various tests.
+       * tests/backsl.test: Enable the `errexit' shell flag, and
+       related changes.
+       * tests/backsl2.test: Likewise.
+       * tests/block.test: Likewise.
+       * tests/canon2.test: Likewise.
+       * tests/canon4.test: Likewise.
+       * tests/comment2.test: Likewise.
+       * tests/condlib.test: Likewise.
+       * tests/cond15.test: Likewise, and prefer $FGREP over grep.
+       * tests/canon3.test: Likewise.  Also, avoid to create an useless
+       dummy source file.
+       * tests/acoutpt2.test: Enable the `errexit' shell flag, and some
+       related changes.  Do some cosmetic improvements in the generated
+       `configure.in' file.
+       * tests/cond4.test: Likewise.
+       * tests/cond14.test: Likewise.
+       * tests/condinc.test: Likewise.
+       * tests/cond7.test: Likewise.  Also, remove useless setting of
+       AUTOMAKE_OPTIONS to `foreign' in the generated Makefile.am.
+       * tests/ansi.test: Enable the `errexit' shell flag, and related
+       changes.  Extended, esp. by running autoconf, ./configure and
+       make, and by looking into the distdir.
+
 2010-06-12  Stefano Lattarini  <stefano.lattarini@gmail.com>
            Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
index fb8fbcf37e003e6860c9a95beb814833047bb529..2d0743c0ffc8c266ff541733881f1fcc443aee16 100755 (executable)
@@ -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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
 AC_OUTPUT([subdir/Makefile subdir/foo Makefile foo], [true])
 END
 
@@ -31,12 +33,14 @@ mkdir subdir
 : > foo.in
 : > subdir/foo.in
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 count=`$FGREP foo.in Makefile.in | wc -l`
-test $count -eq 2 || Exit 1
+test $count -eq 2
 
 # This ought to work as well.
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE --add-missing --force-missing
+
+:
index cd9a07b821f2ec1e181395da988fa963e73f7516..c0778c6ee3994c70328d314df7e8b7c9e4aa9608 100755 (executable)
@@ -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
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = ansi2knr
-magic:
-       @echo $(DISTFILES)
+.PHONY: test1 test2
+test1:
+       echo ' $(DISTFILES) ' | grep ' ansi2knr\.c '
+       echo ' $(DISTFILES) ' | grep ' ansi2knr\.1 '
+test2: distdir
+       test -f $(distdir)/ansi2knr.c
+       test -f $(distdir)/ansi2knr.1
 END
 
 cat >> configure.in << 'END'
 AM_C_PROTOTYPES
+AC_OUTPUT
 END
 
 : > ansi2knr.c
 : > ansi2knr.1
 
-$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 'ansi2knr\.c'
+$MAKE -f Makefile.sed SHELL=$SHELL test1
+
+$AUTOCONF
+./configure
+$MAKE test1
+$MAKE test2
+
+:
index e5d2b395ac6b42b9d1a6350da1ca87662aa8e66e..3947cde6c4ec371a0c65d21295ed4f9bd6a51dd4 100755 (executable)
@@ -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
@@ -27,8 +29,8 @@ bin_PROGRAMS = \
    frob
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^_SOURCE' Makefile.in && Exit 1
 Exit 0
index ba62db7194468f20fdf794e6b0970d822f3bf227..35e9b9be1aa2cfc8ba8c6335c01b5e8846d8a4c4 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 SUBDIRS = \
    .
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
-Exit 0
+:
index 8b4692ac0789144ef63589fb88a80bec50763d08..862389eb077b528ac4862617eddabcd9e11bf4bb 100755 (executable)
@@ -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'
 #START
 #a
@@ -27,8 +29,8 @@ cat > Makefile.am << 'END'
 #END
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 (sed -e '/^#START/,/^#END/ !d' Makefile.in | grep -v '^#') && Exit 1
 Exit 0
index e8acb8182aa3bde91ebd20955129e03a148eb01d..ab2861750e86c4a11a1b8a0ac268e6edf5aca4dc 100755 (executable)
@@ -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
@@ -18,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 info_TEXINFOS = zar-doz.texi
 zar_doz_TEXINFOS = frob.texi
@@ -27,8 +30,9 @@ END
 echo '@setfilename zar-doz.info' > zar-doz.texi
 echo '@setfilename frob' > frob.texi
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep zar-doz_TEXINFOS Makefile.in && Exit 1
-Exit 0
+
+:
index da347ebeea267a72214d29bff6264e79eb972f90..9d5a1723856d6dc05047e90a04b21d5b70482edb 100755 (executable)
@@ -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,8 +30,8 @@ END
 
 : > perm-number.c
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
-grep 'perm_number\.c' Makefile.in && Exit 1
+$FGREP 'perm_number.c' Makefile.in && Exit 1
 Exit 0
index 607ba2e8ad119a63e5fb2bd91a866a8da3ed8538..52e968dc5b55921383fa39e62223206f89dd7ba5 100755 (executable)
@@ -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
 AC_PROG_RANLIB
@@ -28,8 +30,8 @@ noinst_LIBRARIES = libx-y.a
 libx_y_a_SOURCES = xy.c
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^libx-y.*=' Makefile.in && Exit 1
 Exit 0
index 2073328d203b92c400b4682c94ed7c2df16d7561..97e6a2610ba4c7f241497080be35d182043545af 100755 (executable)
@@ -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,8 +29,8 @@ cat > Makefile.am << 'END'
 bin_PROGRAMS = sim_products receive_th receive_pos # image_proc
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^image_proc' Makefile.in && Exit 1
 Exit 0
index 2181325427af879d015061599ec62fc1265b417b..2779a3dd8f6a1b3ca8f32a5b56122bceb693dd74 100755 (executable)
@@ -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
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
-AM_CONDITIONAL(COND1, true)
+AM_CONDITIONAL([COND1], [true])
 END
 
 cat > Makefile.am << 'END'
@@ -43,8 +45,10 @@ endif
 bin_PROGRAMS = $(BUILD_helldl)
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 num=`grep 'helldl$(EXEEXT):' Makefile.in | wc -l`
 test $num -eq 2
+
+:
index a371baa204103c33a481b7dfa1d92ddadc0ba337..0789074c307df7d13e9129ae3f261706238d465c 100755 (executable)
@@ -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
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
-AM_CONDITIONAL(COND1, true)
-AM_CONDITIONAL(COND2, true)
+AM_CONDITIONAL([COND1], [true])
+AM_CONDITIONAL([COND2], [true])
 END
 
 cat > Makefile.am << 'END'
@@ -50,10 +52,12 @@ endif
 bin_PROGRAMS = helldl
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+num1=`$FGREP 'helldl$(EXEEXT):' Makefile.in | wc -l`
+num2=`$FGREP '@COND1_FALSE@@COND2_TRUE@helldl$(EXEEXT):' Makefile.in | wc -l`
+test $num1 -eq 4
+test $num2 -eq 1
 
-num1=`grep 'helldl$(EXEEXT):' Makefile.in | wc -l`
-num2=`grep '@COND1_FALSE@@COND2_TRUE@helldl$(EXEEXT):' Makefile.in | wc -l`
-test $num1 -eq 4 || Exit 1
-test $num2 -eq 1 || Exit 1
+:
index cc569d6a6509551754c9b41f5c71465e37338f05..6efc9ce71ba435420c03cb18cb38529dc3b2d608 100755 (executable)
@@ -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
 required='GNUmake gcc'
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(foo,0.0)
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
-AM_CONDITIONAL(ONE, test "x$CONDITION1" = "xtrue")
-AM_CONDITIONAL(TWO, test "x$CONDITION2" = "xtrue")
-AC_OUTPUT(Makefile)
+AM_CONDITIONAL([ONE], [test "x$CONDITION1" = "xtrue"])
+AM_CONDITIONAL([TWO], [test "x$CONDITION2" = "xtrue"])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -45,33 +45,35 @@ echo-objects:
        @echo $(targ_OBJECTS)
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 # We should not output useless definitions.
-test "`grep '^@TWO_FALSE@' Makefile.in | wc -l`" -eq 0 || Exit 1
+test "`grep '^@TWO_FALSE@' Makefile.in | wc -l`" -eq 0
 
-$AUTOCONF || Exit 1
+$AUTOCONF
 
 # Ignore user CFLAGS.
 CFLAGS=
 export CFLAGS
 
-CONDITION1=true CONDITION2=true ./configure || Exit 1
+CONDITION1=true CONDITION2=true ./configure
 msgtt=`$MAKE --no-print-directory echo-objects`
-CONDITION1=true CONDITION2=false ./configure || Exit 1
+CONDITION1=true CONDITION2=false ./configure
 msgtf=`$MAKE --no-print-directory echo-objects`
-CONDITION1=false CONDITION2=true ./configure || Exit 1
+CONDITION1=false CONDITION2=true ./configure
 msgft=`$MAKE --no-print-directory echo-objects`
-CONDITION1=false CONDITION2=false ./configure || Exit 1
+CONDITION1=false CONDITION2=false ./configure
 msgff=`$MAKE --no-print-directory echo-objects`
 
-echo $msgtt
-echo $msgtf
-echo $msgft
-echo $msgff
+: msgtt = $msgtt
+: msgtf = $msgtf
+: msgft = $msgft
+: msgff = $msgff
+
+test x"$msgtt" = x"main.o one.o two.o"
+test x"$msgtf" = x"main.o one.o"
+test x"$msgft" = x"main.o two.o"
+test x"$msgff" = x"main.o"
 
-test "$msgtt" = "main.o one.o two.o" || Exit 1
-test "$msgtf" = "main.o one.o" || Exit 1
-test "$msgft" = "main.o two.o" || Exit 1
-test "$msgff" = "main.o" || Exit 1
+:
index 4d611baedb6cac32be5c54e46fd2e015d18e12aa..b11dddf185b2dd4d21322f1de5b4b3ede63dd759 100755 (executable)
@@ -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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT()
-AM_INIT_AUTOMAKE(test,0.1)
+set -e
+
+cat >> configure.in << 'END'
 compat=yes
-AM_CONDITIONAL(Compatible, test x$compat = xyes)
-AC_OUTPUT(Makefile)
+AM_CONDITIONAL([Compatible], [test x$compat = xyes])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS=foreign
 if Compatible
 abdir = none
 ab_HEADERS = \
@@ -35,7 +34,8 @@ ab_HEADERS = \
 endif
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
 grep '^[^#].*002' Makefile.in && Exit 1
 Exit 0
index eddd3bcdc78ccf084ffa27f244a1f1d2cddda6c7..cf9e35fcee90382fbf7927d9f2e838c0d8c0c7cd 100755 (executable)
@@ -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
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
-AM_CONDITIONAL(TOBE, false)
+AM_CONDITIONAL([TOBE], [false])
 END
 
 cat > Makefile.am << 'END'
@@ -33,11 +35,10 @@ target: dependency
        rule
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 grep '^target:' Makefile.in && Exit 1
+grep '^@TOBE_TRUE@target:' Makefile.in
 
-grep '^@TOBE_TRUE@target:' Makefile.in || Exit 1
-
-Exit 0
+:
index 49cc9f1f5f7bf653ce5204235ab13f5b96f71b7c..b6c998d71be7c755388b5057b3ca51c77d32dad1 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2008  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -19,6 +19,8 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_RANLIB
 AM_MAINTAINER_MODE
@@ -34,8 +36,8 @@ nodist_librsaref_a_SOURCES = desc.c digit.c
 BUILT_SOURCES = $(nodist_librsaref_a_SOURCES)
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 $FGREP librsaref.a.c Makefile.in && Exit 1
 Exit 0