+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>
#! /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
: > 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
+
+:
#! /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
+
+:
#! /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
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
END
frob
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
grep '^_SOURCE' Makefile.in && Exit 1
Exit 0
#! /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
+:
#! /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
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
#START
#a
#END
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
(sed -e '/^#START/,/^#END/ !d' Makefile.in | grep -v '^#') && Exit 1
Exit 0
#! /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
. ./defs || Exit 1
+set -e
+
cat > Makefile.am << 'END'
info_TEXINFOS = zar-doz.texi
zar_doz_TEXINFOS = frob.texi
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
+
+:
#! /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
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
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
#! /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
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_RANLIB
libx_y_a_SOURCES = xy.c
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
grep '^libx-y.*=' Makefile.in && Exit 1
Exit 0
#! /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
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
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
#! /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'
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
+
+:
#! /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'
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
+:
#! /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'
@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
+:
#! /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 = \
endif
END
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
grep '^[^#].*002' Makefile.in && Exit 1
Exit 0
#! /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'
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
+:
#! /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
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_RANLIB
AM_MAINTAINER_MODE
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