* 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.
2010-08-09 Stefano Lattarini <stefano.lattarini@gmail.com>
+ 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.
#! /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
./configure
$MAKE distdir
test -f nonesuch-nonesuch/templ/README.foo.in
+
+:
#! /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
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
$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
$sleep
$MAKE parse.c parse2.c
test `ls -1t parse.c parse.y | sed 1q` = parse.c
+
+:
#! /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
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'
$ACLOCAL
AUTOMAKE_fails -a
$FGREP 'foo.$(OBJEXT)' stderr
+
+:
#! /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
set -e
-cat >main.c <<EOF
+cat > main.c <<'EOF'
int main() { return 0; }
EOF
# 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
+
+:
#! /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
required=gcc
. ./defs || Exit 1
+set -e
+
mkdir foo
cat >foo/main.c <<'EOF'
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
+
:
#! /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
$ACLOCAL
$AUTOMAKE -a
+
test -f config.sub
test -f config.guess
+
+:
. ./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
+
+:
. ./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
+
+:
. ./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
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
+:
. ./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
foo_DEPENDENCIES =
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
+set -e
+
+cat >> configure.in << 'END'
AC_PROG_CC
-AC_CONFIG_FILES(Makefile)
AC_OUTPUT
END
chmod +x foo
-set -e
-
mkdir install
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
+
./configure "--prefix=`cd install && pwd`"
+
$MAKE
$MAKE distdir
+
+:
#! /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
$ACLOCAL
$AUTOCONF
$AUTOMAKE --copy --add-missing
+
./configure --prefix "`pwd`/inst"
+
$MAKE
test -f subdir/liba.a
test -f inst/lib/liba.a
test -f inst/lib/subdir/libb.a
+
+:
$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
test -f inst/lib/liba.la
test -f inst/lib/subdir/libb.la
+
+:
#! /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
$ACLOCAL
$AUTOCONF
$AUTOMAKE --copy --add-missing
+
./configure --prefix "`pwd`/inst"
+
$MAKE test-all
$MAKE test-install
$MAKE test-uninstall
$MAKE test-install-strip
+
+:
#! /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
required='libtoolize gcc'
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_LIBTOOL
# 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 <tst` -eq 2 || exit 1; \
done
END
EOF
done
-set -e
-
libtoolize --force
$ACLOCAL
$AUTOCONF
grep am_cv_CC_dependencies_compiler_type configure
./configure am_cv_CC_dependencies_compiler_type=dashmstdout
+
$MAKE
test -f librace.la && Exit 1
$MAKE check
test -f librace.la
test -f tst # a proof that check-local was run
+
+:
#! /bin/sh
-# Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006, 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
$AUTOMAKE
./configure
$MAKE distcheck
+
+:
#! /bin/sh
-# Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006, 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
$AUTOMAKE
./configure
$MAKE distcheck
+
+:
#! /bin/sh
-# Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006, 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
$AUTOMAKE
./configure
$MAKE distcheck
+
+:
#! /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
required=libtool
. ./defs || Exit 1
+set -e
+
cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_LIBTOOL
: > config.guess
: > config.sub
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+grep '^LINK =' Makefile.in
-grep '^LINK ' 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
required=gcc
. ./defs || Exit 1
+set -e
+
subdirs="foo bar"
for i in $subdirs; do
cat >configure.in <<EOF
AC_INIT(`echo $subdirs | sed 's|\([a-z][a-z]*\).*|\1/\1.c|'`)
AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE(test_am, 1.0)
+AM_INIT_AUTOMAKE($me, 1.0)
AC_PROG_CC
AC_OUTPUT(Makefile `echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g'`)
EOF
CFLAGS=
export CFLAGS
-touch README NEWS AUTHORS ChangeLog
-
mkdir build
-# We use gcc and not gcc -traditional as the latter fails on some
-# Linux boxes (Red Hat 5.1 in particular).
-$ACLOCAL \
- && $AUTOCONF \
- && $AUTOMAKE -a || Exit 1
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
# Regression test for bug where `.c.o:' is followed by blank line.
(while read line; do
read next
if test -z "$next"; then
Exit 1
+ else
+ : # for shells with broken 'set -e'
fi
break
fi
done) < foo/Makefile.in || Exit 1
-cd build \
- && ../configure \
- && $MAKE distcheck || Exit 1
+cd build
+../configure
+$MAKE distcheck
+
+:
#! /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
required=gzip
. ./defs || Exit 1
-cat > 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
+: