From: Stefano Lattarini Date: Sat, 26 Jun 2010 13:33:50 +0000 (+0200) Subject: Modernize, improve and extend tests for PR (`pr[0-9]*.test'). X-Git-Tag: v1.11.1b~62^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ca2fc96af5d85f26848619ef1024c4bbfa9ebed;p=thirdparty%2Fautomake.git Modernize, improve and extend tests for PR (`pr[0-9]*.test'). * tests/pr2.test: Add trailing `:' command. * tests/pr229.test: Likewise. * tests/pr401.test: Likewise. * tests/pr401b.test: Likewise. * tests/pr401c.test: Likewise. * tests/pr300-prog.test: Likewise, plus cosmetic changes in spacing. * tests/pr300-lib.test: Likewise. * tests/pr300-ltlib.test: Likewise, and ensure verbose printing of captured make stdout. * tests/pr211.test: Add trailing `:' command. Also, use the `configure.in' stub created by ./defs, rather than writing it from scratch. * tests/pr204.test: Likewise, plus cosmetic spacing changes. * tests/pr287.test: Likewise, and move setting of `errexit' shell flag earlier in the script (just after inclusion of ./defs). * tests/pr220.test: Make grepping of Automake's stderr stricter. Also, add trailing `:' command, and cosmetic changes in spacing. * tests/pr224.test: Move setting of `errexit' shell flag earlier in the script (just after inclusion of ./defs). Do not export `CC=gcc' to configure explicitly (it's already exported globally in ./defs, since we have "gcc" in $required). Use the stub for `configure.in' created by ./defs, rather than writing it from scratch. Do not create dummy files required by "gnu" mode (e.g. README, NEWS), since we run automake in foreign mode anyway. * tests/pr72.test: Enable `errexit' shell flags, and related changes. Extend existing checks a bit. * tests/pr9.test: Likewise. Also, avoid obolescent constructs in the generated `configure.in', and extend existing checks over the generated tarball a bit. * tests/pr87.test: Enable `errexit' shell flags, and related changes. Add a trailing `:' command. Also, do not create dummy files required by "gnu" mode (e.g. README, NEWS), since we run automake in foreign mode anyway. * tests/pr243.test: Avoid obolescent constructs in the generated `configure.in'. Enable the `errexit' shell flag, and related changes. Cosmetic changes to spacing, add trailing `:' command, and add a "FIXME" comment. * tests/pr266.test: Likewise, and add explicit command line switch `--enable-dependecy-tracking' to the ./configure call. * tests/pr279.test: Avoid obolescent constructs in the generated `configure.in'; also, use the `configure.in' stub created by ./defs, rather than writing it from scratch. Enable `errexit' shell flag, and related changes. Add trailing `:' command. * tests/pr279-2.test: Likewise, and make grepping of Makefile.in stricter. * tests/pr307.test: Move setting of `errexit' shell flag earlier in the script (just after inclusion of ./defs). Escape literal dots in grep regular expressions. Also, add a trailing `:' command, and cosmetic changes to spacing. --- diff --git a/ChangeLog b/ChangeLog index bfc7f91d5..633703e53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,57 @@ 2010-08-09 Stefano Lattarini + Modernize, improve and extend tests for PR (`pr[0-9]*.test'). + * tests/pr2.test: Add trailing `:' command. + * tests/pr229.test: Likewise. + * tests/pr401.test: Likewise. + * tests/pr401b.test: Likewise. + * tests/pr401c.test: Likewise. + * tests/pr300-prog.test: Likewise, plus cosmetic changes in + spacing. + * tests/pr300-lib.test: Likewise. + * tests/pr300-ltlib.test: Likewise, and ensure verbose printing + of captured make stdout. + * tests/pr211.test: Add trailing `:' command. Also, use the + `configure.in' stub created by ./defs, rather than writing it + from scratch. + * tests/pr204.test: Likewise, plus cosmetic spacing changes. + * tests/pr287.test: Likewise, and move setting of `errexit' shell + flag earlier in the script (just after inclusion of ./defs). + * tests/pr220.test: Make grepping of Automake's stderr stricter. + Also, add trailing `:' command, and cosmetic changes in spacing. + * tests/pr224.test: Move setting of `errexit' shell flag earlier + in the script (just after inclusion of ./defs). Do not export + `CC=gcc' to configure explicitly (it's already exported globally + in ./defs, since we have "gcc" in $required). Use the stub for + `configure.in' created by ./defs, rather than writing it from + scratch. Do not create dummy files required by "gnu" mode (e.g. + README, NEWS), since we run automake in foreign mode anyway. + * tests/pr72.test: Enable `errexit' shell flags, and related + changes. Extend existing checks a bit. + * tests/pr9.test: Likewise. Also, avoid obolescent constructs in + the generated `configure.in', and extend existing checks over the + generated tarball a bit. + * tests/pr87.test: Enable `errexit' shell flags, and related + changes. Add a trailing `:' command. Also, do not create dummy + files required by "gnu" mode (e.g. README, NEWS), since we run + automake in foreign mode anyway. + * tests/pr243.test: Avoid obolescent constructs in the generated + `configure.in'. Enable the `errexit' shell flag, and related + changes. Cosmetic changes to spacing, add trailing `:' command, + and add a "FIXME" comment. + * tests/pr266.test: Likewise, and add explicit command line switch + `--enable-dependecy-tracking' to the ./configure call. + * tests/pr279.test: Avoid obolescent constructs in the generated + `configure.in'; also, use the `configure.in' stub created by + ./defs, rather than writing it from scratch. Enable `errexit' + shell flag, and related changes. Add trailing `:' command. + * tests/pr279-2.test: Likewise, and make grepping of Makefile.in + stricter. + * tests/pr307.test: Move setting of `errexit' shell flag earlier + in the script (just after inclusion of ./defs). Escape literal + dots in grep regular expressions. Also, add a trailing `:' + command, and cosmetic changes to spacing. + Tests for PR: add excerpts from original bug report, for clarity. * tests/pr2.test: Ditto. * tests/pr9.test: Likewise. diff --git a/tests/pr2.test b/tests/pr2.test index 833033171..ceb272906 100755 --- a/tests/pr2.test +++ b/tests/pr2.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2006 Free Software +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2006, 2010 Free Software # Foundation, Inc. # # This program is free software; you can redistribute it and/or modify @@ -50,3 +50,5 @@ $AUTOMAKE ./configure $MAKE distdir test -f nonesuch-nonesuch/templ/README.foo.in + +: diff --git a/tests/pr204.test b/tests/pr204.test index 2944449c2..22a1e54f5 100755 --- a/tests/pr204.test +++ b/tests/pr204.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002, 2004 Free Software Foundation, Inc. +# Copyright (C) 2002, 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 @@ -22,13 +22,10 @@ required='bison gcc' set -e -cat > configure.in <<'EOF' -AC_INIT(pr204, 0.1) -AM_INIT_AUTOMAKE +cat >> configure.in <<'EOF' AM_MAINTAINER_MODE AC_PROG_CC AC_PROG_YACC -AC_CONFIG_FILES(Makefile) AC_OUTPUT EOF @@ -64,8 +61,10 @@ cp parse.y parse2.y $ACLOCAL $AUTOCONF $AUTOMAKE -a + ./configure $MAKE distdirtest + # Make sure parse.c and parse2.c are still targets. $MAKE parse.c parse2.c test -f parse.c @@ -78,3 +77,5 @@ touch parse.y $sleep $MAKE parse.c parse2.c test `ls -1t parse.c parse.y | sed 1q` = parse.c + +: diff --git a/tests/pr211.test b/tests/pr211.test index f29797a75..6778f7a06 100755 --- a/tests/pr211.test +++ b/tests/pr211.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 @@ -32,12 +32,10 @@ required=libtoolize set -e -cat > configure.in << 'END' -AC_INIT(Makefile.am) -AM_INIT_AUTOMAKE(hello,0.23) +cat >> configure.in << 'END' AC_PROG_CC AC_PROG_LIBTOOL -AC_OUTPUT(Makefile) +AC_OUTPUT END cat > Makefile.am << 'END' @@ -51,3 +49,5 @@ libtoolize $ACLOCAL AUTOMAKE_fails -a $FGREP 'foo.$(OBJEXT)' stderr + +: diff --git a/tests/pr220.test b/tests/pr220.test index 9525694c8..95212ab0e 100755 --- a/tests/pr220.test +++ b/tests/pr220.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 2001, 2002, 2004, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2004, 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 @@ -27,7 +28,7 @@ required=gcc set -e -cat >main.c < main.c <<'EOF' int main() { return 0; } EOF @@ -63,4 +64,6 @@ cd build # configure should fail since we've done something invalid. ../configure 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 -grep NEVER_TRUE stderr +grep 'conditional.*NEVER_TRUE' stderr + +: diff --git a/tests/pr224.test b/tests/pr224.test index 63f78f1c6..00a7aad6e 100755 --- a/tests/pr224.test +++ b/tests/pr224.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 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 @@ -26,6 +26,8 @@ required=gcc . ./defs || Exit 1 +set -e + mkdir foo cat >foo/main.c <<'EOF' @@ -38,30 +40,24 @@ bin_PROGRAMS = bar bar_SOURCES = foo/main.c EOF -cat >configure.in <<'EOF' -AC_INIT(foo/main.c) -AC_CONFIG_AUX_DIR(.) -AM_INIT_AUTOMAKE(test_am, 1.0) +cat >>configure.in <<'EOF' AC_PROG_CC AM_PROG_CC_C_O -AC_OUTPUT(Makefile) +AC_OUTPUT EOF -touch README NEWS AUTHORS ChangeLog - mkdir build -set -e - $ACLOCAL $AUTOCONF $AUTOMAKE -a cd build -CC='gcc' ../configure -$MAKE +../configure +$MAKE test -d foo/.deps $MAKE distclean test -d foo/.deps && Exit 1 + : diff --git a/tests/pr229.test b/tests/pr229.test index 3efa6ed9d..0d3f15383 100755 --- a/tests/pr229.test +++ b/tests/pr229.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 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 @@ -30,5 +30,8 @@ EOF $ACLOCAL $AUTOMAKE -a + test -f config.sub test -f config.guess + +: diff --git a/tests/pr243.test b/tests/pr243.test index cf39b880d..58fb2a824 100755 --- a/tests/pr243.test +++ b/tests/pr243.test @@ -28,27 +28,32 @@ . ./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_INIT([$me], [1.0]) +AM_INIT_AUTOMAKE AC_PROG_CC -AC_CONFIG_FILES(Makefile:Makefile.in:tail.mk) +AC_CONFIG_FILES([Makefile:Makefile.in:tail.mk]) AC_OUTPUT END : > tail.mk cat > Makefile.am << 'END' -include_HEADERS = 3dfx.h linutil.h -noinst_HEADERS = fx64.h fxdll.h fximg.h fxglob.h \ - fxos.h fxver.h glob.h +include_HEADERS = 3dfx.h linutil.h +noinst_HEADERS = fx64.h fxdll.h fximg.h fxglob.h \ + fxos.h fxver.h glob.h noinst_PROGRAMS = fxmisc -fxmisc_SOURCES = fx64.c fximg.c fxos.c linutil.c +fxmisc_SOURCES = fx64.c fximg.c fxos.c linutil.c END -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 -$AUTOCONF || Exit 1 +$ACLOCAL +$AUTOMAKE +$AUTOCONF +# FIXME: require compiler in $required rather than skipping here ./configure || Exit $? test -f .deps/fx64.Po + +: diff --git a/tests/pr266.test b/tests/pr266.test index f2b54dd06..2bace6f92 100755 --- a/tests/pr266.test +++ b/tests/pr266.test @@ -19,25 +19,30 @@ . ./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_INIT([$me], [1.0]) +AM_INIT_AUTOMAKE AC_PROG_CC -AC_CONFIG_FILES(Maudefile) +AC_CONFIG_FILES([Maudefile]) AC_OUTPUT END cat > Maudefile.am << 'END' -include_HEADERS = 3dfx.h linutil.h -noinst_HEADERS = fx64.h fxdll.h fximg.h fxglob.h \ - fxos.h fxver.h glob.h +include_HEADERS = 3dfx.h linutil.h +noinst_HEADERS = fx64.h fxdll.h fximg.h fxglob.h \ + fxos.h fxver.h glob.h noinst_PROGRAMS = fxmisc -fxmisc_SOURCES = fx64.c fximg.c fxos.c linutil.c +fxmisc_SOURCES = fx64.c fximg.c fxos.c linutil.c END -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 -$AUTOCONF || Exit 1 -./configure || Exit $? +$ACLOCAL +$AUTOMAKE +$AUTOCONF +# FIXME: require compiler in $required rather than skipping here +./configure --enable-dependency-tracking || Exit $? test -f .deps/fx64.Po + +: diff --git a/tests/pr279-2.test b/tests/pr279-2.test index 5bc9f8532..f4e6fb2d8 100755 --- a/tests/pr279-2.test +++ b/tests/pr279-2.test @@ -26,12 +26,11 @@ . ./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 @@ -45,8 +44,10 @@ endif bin_PROGRAMS = foo END -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE + +grep '^@FOOTEST_TRUE@foo_DEPENDENCIES *= *zardoz$' Makefile.in +grep '^@FOOTEST_FALSE@foo_DEPENDENCIES *= *maude$' Makefile.in -grep '@foo_DEPENDENCIES = zardoz' Makefile.in || Exit 1 -grep '@foo_DEPENDENCIES = maude' Makefile.in || Exit 1 +: diff --git a/tests/pr279.test b/tests/pr279.test index ba11b2dfc..d658668f7 100755 --- a/tests/pr279.test +++ b/tests/pr279.test @@ -26,12 +26,11 @@ . ./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 @@ -47,5 +46,7 @@ foo_LDADD = ${xtralib} foo_DEPENDENCIES = END -$ACLOCAL || Exit 1 +$ACLOCAL $AUTOMAKE + +: diff --git a/tests/pr287.test b/tests/pr287.test index 58553b520..3a6f902f9 100755 --- a/tests/pr287.test +++ b/tests/pr287.test @@ -1,5 +1,5 @@ #! /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 @@ -18,11 +18,10 @@ . ./defs || Exit 1 -cat > configure.in << 'END' -AC_INIT(foo, 0.1, dev@null) -AM_INIT_AUTOMAKE +set -e + +cat >> configure.in << 'END' AC_PROG_CC -AC_CONFIG_FILES(Makefile) AC_OUTPUT END @@ -38,13 +37,15 @@ END chmod +x foo -set -e - mkdir install $ACLOCAL $AUTOCONF $AUTOMAKE -a + ./configure "--prefix=`cd install && pwd`" + $MAKE $MAKE distdir + +: diff --git a/tests/pr300-lib.test b/tests/pr300-lib.test index 3d2fde5b9..ee46b4b44 100755 --- a/tests/pr300-lib.test +++ b/tests/pr300-lib.test @@ -1,5 +1,5 @@ #! /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 @@ -46,7 +46,9 @@ END $ACLOCAL $AUTOCONF $AUTOMAKE --copy --add-missing + ./configure --prefix "`pwd`/inst" + $MAKE test -f subdir/liba.a @@ -66,3 +68,5 @@ $MAKE install-strip test -f inst/lib/liba.a test -f inst/lib/subdir/libb.a + +: diff --git a/tests/pr300-ltlib.test b/tests/pr300-ltlib.test index c6f9a5ed9..c47f32eba 100755 --- a/tests/pr300-ltlib.test +++ b/tests/pr300-ltlib.test @@ -48,8 +48,10 @@ libtoolize $ACLOCAL $AUTOCONF $AUTOMAKE --copy --add-missing + ./configure --prefix "`pwd`/inst" -$MAKE V=1 >stdout + +$MAKE V=1 >stdout || { cat stdout; Exit 1; } cat stdout grep 'liba.la .*-rpath .*lib' stdout @@ -75,3 +77,5 @@ $MAKE install-strip test -f inst/lib/liba.la test -f inst/lib/subdir/libb.la + +: diff --git a/tests/pr300-prog.test b/tests/pr300-prog.test index 0b226c626..917a8a201 100755 --- a/tests/pr300-prog.test +++ b/tests/pr300-prog.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 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 @@ -63,8 +63,12 @@ END $ACLOCAL $AUTOCONF $AUTOMAKE --copy --add-missing + ./configure --prefix "`pwd`/inst" + $MAKE test-all $MAKE test-install $MAKE test-uninstall $MAKE test-install-strip + +: diff --git a/tests/pr307.test b/tests/pr307.test index 9890289e4..7676c4bc6 100755 --- a/tests/pr307.test +++ b/tests/pr307.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002, 2004 Free Software Foundation, Inc. +# Copyright (C) 2002, 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 @@ -35,6 +35,8 @@ required='libtoolize gcc' . ./defs || Exit 1 +set -e + cat >> configure.in << 'END' AC_PROG_CC AC_PROG_LIBTOOL @@ -48,8 +50,8 @@ librace_la_SOURCES = a.c b.c c.c d.c e.c f.c g.c h.c # Make sure the dependencies are updated. check-local: for i in $(librace_la_SOURCES:.c=.Plo); do \ - echo checking ./$(DEPDIR)/$$i; \ - grep foo.h ./$(DEPDIR)/$$i >tst || exit 1; \ + echo "checking ./$(DEPDIR)/$$i"; \ + grep 'foo\.h' ./$(DEPDIR)/$$i >tst || exit 1; \ test `wc -l > configure.in << 'END' AC_PROG_CC AC_PROG_LIBTOOL @@ -36,7 +38,9 @@ END : > config.guess : > config.sub -$ACLOCAL || Exit 1 -$AUTOMAKE || Exit 1 +$ACLOCAL +$AUTOMAKE + +grep '^LINK =' Makefile.in -grep '^LINK ' Makefile.in +: diff --git a/tests/pr87.test b/tests/pr87.test index 187d5ea1b..31e64829c 100755 --- a/tests/pr87.test +++ b/tests/pr87.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 @@ -20,6 +20,8 @@ required=gcc . ./defs || Exit 1 +set -e + subdirs="foo bar" for i in $subdirs; do @@ -37,7 +39,7 @@ echo "SUBDIRS = $subdirs" > Makefile.am cat >configure.in < configure.in << 'END' -AC_INIT(Makefile.am) -AC_CONFIG_AUX_DIR(support) -AM_INIT_AUTOMAKE(pr9, 0) -AC_OUTPUT(Makefile) +set -e + +cat > configure.in << END +AC_INIT([$me], [1.0]) +AC_CONFIG_AUX_DIR([support]) +AM_INIT_AUTOMAKE +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT END : > Makefile.am mkdir support -$ACLOCAL || Exit 1 +$ACLOCAL + +$AUTOCONF +$AUTOMAKE -a -c +./configure +$MAKE +$MAKE distcheck + +distdir=$me-1.0 + +gzip -d $distdir.tar.gz -$AUTOCONF || Exit 1 -$AUTOMAKE -a -c || Exit 1 -./configure || Exit 1 -$MAKE || Exit 1 -$MAKE distcheck || Exit 1 +tar tf $distdir.tar | $FGREP support -gunzip pr9-0.tar.gz || Exit 1 +tar xf $distdir.tar +ls -l . $distdir # for debugging +test -d $distdir/support +ls -l $distdir/support # for debugging +test -f $distdir/support/install-sh -tar tf pr9-0.tar | $FGREP support +: