2010-06-12 Stefano Lattarini <stefano.lattarini@gmail.com>
+ Modernize, improve and/or fix various test scripts.
+ * tests/symlink3.test: Deleted, separated into two new, more
+ complete tests ...
+ * tests/forcemiss.test: ... this one ...
+ * tests/forcemiss2.test: ... and this one.
+ * tests/symlink2.test: Enable `errexit' shell flag, make test
+ stricter, and skip it if symlink creation is not supported.
+ * tests/postproc.test: Enable `errexit' shell flag, related
+ changes, and a couple of unrelated cosmetic changes.
+ * tests/recurs.test: Use the `configure.in' stub created by
+ `./defs', rather than writing one from scratch. Make grepping
+ of Automake stderr slighty stricter.
+ * tests/substtarg.test: Likewise.
+ * tests/strip.test: Likewise, and move the call to `set -e'
+ earlier (just after the inclusion of `./defs'). Also, make sure
+ that the script installed by `make install-script' is equal to
+ the original one.
+ * tests/substref.test: Use the `configure.in' stub created by
+ `./defs', rather than writing one from scratch. Move the call
+ to `set -e' earlier (just after the inclusion of `./defs').
+ Avoid to explicitly export CC for configure (that's already done
+ in ./defs). Avoid potential problems with unpredictable make
+ output. Finally, make grepping of Makefile.in stricter.
+ * tests/substre2.test: Ensure verbose printing of the captured
+ make's output, and make its grepping slighty stricter.
+ * tests/cygwin32.test: Enable `errexit' shell flag, and related
+ changes. Also, do not create useless dummy source/data files.
+ * tests/scripts.test: Likewise.
+ * tests/recurs2.test: Likewise. Also, use the `configure.in'
+ stub created by `./defs'.
+ * tests/Makefile.am (TESTS): Updated.
+
Modernize, improve and/or fix tests `pluseq*.test.
* tests/pluseq5.test: Append to configure.in using cat with an
here-doc, not using echo.
fn99subdir.test \
fnoc.test \
fo.test \
+forcemiss.test \
+forcemiss2.test \
fort1.test \
fort2.test \
fort4.test \
suffix13.test \
symlink.test \
symlink2.test \
-symlink3.test \
syntax.test \
tags.test \
tagsub.test \
fn99subdir.test \
fnoc.test \
fo.test \
+forcemiss.test \
+forcemiss2.test \
fort1.test \
fort2.test \
fort4.test \
suffix13.test \
symlink.test \
symlink2.test \
-symlink3.test \
syntax.test \
tags.test \
tagsub.test \
#! /bin/sh
-# Copyright (C) 1997, 1999, 2001, 2002, 2008 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999, 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_CC
END
www_LDADD = @extra_stuff@
END
-: > www.c
-: > xtra.c
-
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
grep '^CYGWIN' Makefile.in && Exit 1
grep 'EXEEXT' Makefile.in
+
+:
#! /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
. ./defs || Exit 1
+set -e
+
rm -f install-sh
-rm -f mkinstalldirs
-echo zot > zot
-echo zot > mkinstalldirs
+echo zot > install-sh
: > Makefile.am
-$ACLOCAL || Exit 1
-$AUTOMAKE --add-missing --force-missing || Exit 1
+$ACLOCAL
+$AUTOMAKE --add-missing --force-missing
+
+ls -l install-sh
+test -f install-sh
+grep zot install-sh && Exit 1
-grep zot mkinstalldirs && Exit 1
-Exit 0
+:
--- /dev/null
+#! /bin/sh
+# 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test to make sure that `automake --force-missing' works, even with
+# symlinked files.
+
+. ./defs || Exit 1
+
+set -e
+
+rm -f install-sh
+
+echo zot > foo
+cp foo foo2
+
+ln -s foo2 install-sh || {
+ echo "$me: cannot create symlinks to files" >&2
+ Exit 77
+}
+
+: > Makefile.am
+
+$ACLOCAL
+ls -l install-sh
+$AUTOMAKE --add-missing --force-missing
+ls -l install-sh
+
+test -f install-sh
+grep zot install-sh && Exit 1
+diff foo foo2
+
+:
#! /bin/sh
-# Copyright (C) 2002, 2004, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004, 2009, 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([mumble], [0.1])
+set -e
+
+cat >configure.in <<END
+AC_INIT([$me], [1.0])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_CONFIG_FILES([myMakefile])
fred_SOURCES = fred.c
END
-$ACLOCAL || Exit 1
-$AUTOCONF || Exit 1
-$AUTOMAKE -- myMakefile || Exit 1
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -- myMakefile
mv myMakefile.in myMakefile.old
echo '# Post-processed by post-processor 3.14.' > myMakefile.in
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1998, 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
set -e
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat >> configure.in << 'END'
AC_PROG_CC
AM_CONDITIONAL(ONE, true)
AM_CONDITIONAL(TWO, false)
-AC_OUTPUT(Makefile)
END
cat > Makefile.am << 'END'
$ACLOCAL
AUTOMAKE_fails
-grep 'Makefile.am:.*bin_PROGRAMS.*recursively defined' stderr
+grep 'Makefile\.am:.*bin_PROGRAMS.*recursively defined' stderr
+
+:
#! /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(nonesuch, nonesuch)
-AC_PROG_CC
-AC_OUTPUT(Makefile)
-END
+set -e
cat > Makefile.am << 'END'
man_MANS = chgrp.1
EXTRA_DIST = $(man_aux) $(man_MANS)
END
-> chgrp.1
-> chgrp.x
-
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE
#! /bin/sh
-# Copyright (C) 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1996, 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
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AC_OUTPUT(Makefile)
-END
+set -e
cat > Makefile.am << 'END'
noinst_SCRIPTS = foo
END
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE
#! /bin/sh
-# Copyright (C) 2002, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2007, 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(foo, 0.1, dev@null)
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+set -e
+
+cat >> configure.in << 'END'
AC_PROG_CC
-AM_CONDITIONAL(FOOTEST, false)
-AC_CONFIG_FILES(Makefile)
+AM_CONDITIONAL([FOOTEST], [false])
AC_OUTPUT
END
chmod +x foo
-set -e
-
mkdir install
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-./configure "--prefix=`cd install && pwd`"
+
+prefix=`cd install && pwd` || Exit 1
+./configure --prefix="$prefix"
$MAKE
$MAKE install-strip
+diff foo "$prefix"/bin/foo
+
+:
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 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
$AUTOCONF
$AUTOMAKE -a
./configure
-$MAKE echorule >output
+$MAKE echorule >output || { cat output; Exit 1; }
cat output
-grep 'BEG: foo1.obj foo4.obj bar3.obj bar4.obj :END' output
+$FGREP 'BEG: foo1.obj foo4.obj bar3.obj bar4.obj :END' output
+
+:
#! /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
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test for bug in variable substitution references when left hand pattern is
-# null.
+# Test for bug in variable substitution references when left hand
+# pattern is null.
# Report from Richard Boulton
required=gcc
. ./defs || Exit 1
-cat > configure.in << 'END'
-AC_INIT(hello.c)
-AM_INIT_AUTOMAKE(hello,0.23)
+set -e
+
+cat >> configure.in << 'END'
AC_PROG_CC
-AC_OUTPUT(Makefile)
+AC_OUTPUT
END
cat > hello.c << 'END'
helldl_SOURCES = $(var2:=c)
-echorule:
- @echo $(helldl_SOURCES) $(helldl_OBJECTS)
-
bin_PROGRAMS = helldl
+
+got:
+ @echo $(helldl_SOURCES) $(helldl_OBJECTS) >got
+
END
# Ignore user CFLAGS.
CFLAGS=
export CFLAGS
-set -e
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-CC='gcc' ./configure
+./configure
-val=`$MAKE -s echorule`;
-echo $val
-test "x$val" = "xdlmain.c dlmain.o"
+echo dlmain.c dlmain.o >exp
+$MAKE got
+cat got
+diff exp got
# This is unrelated to the rest of this test. But while we are
# at it, make sure we don't use am__helldl_SOURCES_DIST here, since
# it's not needed. DIST_SOURCES should contains $(helldl_SOURCES).
grep am__helldl_SOURCES_DIST Makefile && Exit 1
-grep 'DIST_SOURCES.*\(helldl_SOURCES\)' Makefile
+grep 'DIST_SOURCES.*\$(helldl_SOURCES)' Makefile
+
+:
#! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2004, 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
set -e
-cat > configure.in << 'END'
-AC_INIT(fakelib.c)
-AM_INIT_AUTOMAKE(fakelib,0.0)
+cat >> configure.in << 'END'
+AC_CONFIG_SOURCE([fakelib.c])
AC_PROG_CC
RANLIB=:
-AC_SUBST(RANLIB)
+AC_SUBST([RANLIB])
SUBST=hei
-AC_SUBST(SUBST)
-AC_OUTPUT(Makefile)
+AC_SUBST([SUBST])
+AC_OUTPUT
END
cat > Makefile.am << 'END'
#! /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
. ./defs || Exit 1
+set -e
+
rm -f install-sh
-rm -f mkinstalldirs
-ln -s Zardoz mkinstalldirs
+ln -s Zardoz install-sh || {
+ echo "$me: cannot create broken symlinks" >&2
+ Exit 77
+}
: > Makefile.am
-$ACLOCAL || Exit 1
+$ACLOCAL
$AUTOMAKE --add-missing
+
+test -f install-sh
+test ! -r Zardoz
+
+: