diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-03-14 22:29:59 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-03-14 22:35:29 +0100 |
commit | 6a6bc51eebe4c702b1ae26acca79c3b865fd8981 (patch) | |
tree | 104694d88132b0e1172509292a1ca70f20e6b82c /tests | |
parent | 28ed42d905141d2ab4f8431b0599c906fe7c6408 (diff) | |
parent | 52ce42bbaf56e5eae76ea8f4fe1484c23c0fa10d (diff) | |
download | automake-6a6bc51eebe4c702b1ae26acca79c3b865fd8981.tar.gz |
Merge branch 'maint'
* maint:
tests: avoid spurious failures in get-sysconf.test
scripts: bump the depcomp scriptversion
sync: some auxiliary files synced from upstream
coverage: an empty foo_PRIMARY should create directory $(foodir)
coverage: make sure am__py_compile is defined when needed
coverage: expose automake bug#10997
coverage: expose automake bug#10975
getopt: relax version requirement for perl
+ Extra non-trivial edits:
* tests/dist-pr109765.test: Use 'configure.ac', not 'configure.in'.
* tests/instdir-cond.test: Likewise.
* tests/instdir-empty.test: Likewise.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rwxr-xr-x | tests/dist-pr109765.test | 44 | ||||
-rwxr-xr-x | tests/get-sysconf.test | 13 | ||||
-rw-r--r-- | tests/instdir-cond.test | 49 | ||||
-rw-r--r-- | tests/instdir-empty.test | 58 | ||||
-rw-r--r-- | tests/list-of-tests.mk | 3 | ||||
-rwxr-xr-x | tests/python.test | 19 |
7 files changed, 183 insertions, 5 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index c14a3909e..1126204eb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -39,6 +39,8 @@ yacc-bison-skeleton.test \ cond17.test \ gcj6.test \ override-conditional-2.test \ +dist-pr109765.test \ +instdir-cond.test \ java-nobase.test \ objext-pr10128.test \ parallel-tests-many.test \ diff --git a/tests/dist-pr109765.test b/tests/dist-pr109765.test new file mode 100755 index 000000000..f1f97befa --- /dev/null +++ b/tests/dist-pr109765.test @@ -0,0 +1,44 @@ +#! /bin/sh +# Copyright (C) 2012 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/>. + +# Expose automake bug#10975: when several "dist-*" targets are invoked +# on the make command line, the first one ends up removing the distdir, +# so that the latter ones fail. + +required=bzip2 +. ./defs || Exit 1 + +set -e + +echo AC_OUTPUT >> configure.ac +: > Makefile.am + +$ACLOCAL || fatal_ "aclocal failed" +$AUTOCONF || fatal_ "autoconf failed" +$AUTOMAKE || fatal_ "automake failed" + +./configure +$MAKE dist-gzip dist-bzip2 + +gzip -dc $distdir.tar.gz | tar tf - > one || { cat one; Exit 1; } +cat one +bzip2 -dc $distdir.tar.gz | tar tf - > two || { cat two; Exit 1; } +cat two + +$FGREP "$distdir/Makefile.am" one +diff one two + +: diff --git a/tests/get-sysconf.test b/tests/get-sysconf.test index 5b3c9e2cb..ae3310e5d 100755 --- a/tests/get-sysconf.test +++ b/tests/get-sysconf.test @@ -25,16 +25,21 @@ st=0 if test -d "$top_testsrcdir"/.git; then # We are running from a git checkout. - git log -1 || st=1 -else - # We are probably running from a distribution tarball, so - # the ChangeLog file must be present. + (cd "$top_testsrcdir" && git log -1) || st=1 +elif test -f "$top_testsrcdir"/ChangeLog; then + # We are probably running from a distribution tarball. awk ' BEGIN { first = 1 } (first == 1) { print; first = 0; next; } /^[^\t]/ { exit(0); } { print } ' "$top_testsrcdir"/ChangeLog || st=1 +else + # Some non-common but possibly valid setup (see for example the Homebrew + # problem reported in automake bug#10866); so just give an harmless + # warning instead of failing. + warn_ "no .git directory nor ChangeLog file found, some info won't" \ + "be available" fi $PERL -V || st=1 # It's OK for the user not to have the TAP::Parser module; this can diff --git a/tests/instdir-cond.test b/tests/instdir-cond.test new file mode 100644 index 000000000..1cbd5bbf5 --- /dev/null +++ b/tests/instdir-cond.test @@ -0,0 +1,49 @@ +#! /bin/sh +# Copyright (C) 2012 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/>. + +# Check against automake bug#10997: directories holding only +# conditionally-installed files should not be created unconditionally. + +. ./defs || Exit 1 + +set -e + +cat >> configure.ac << 'END' +AM_CONDITIONAL([ENABLE_FOO], [false]) +AC_OUTPUT +END + +: > foo +: > bar + +cat > Makefile.am << 'END' +if ENABLE_FOO +pkgdata_DATA = foo +pkglibexec_SCRIPTS = bar +endif +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +./configure --prefix="`pwd`/inst" + +$MAKE install +test ! -d inst/share/instdir-cond +test ! -d inst/libexec/instdir-cond + +: diff --git a/tests/instdir-empty.test b/tests/instdir-empty.test new file mode 100644 index 000000000..b6eab65d3 --- /dev/null +++ b/tests/instdir-empty.test @@ -0,0 +1,58 @@ +#! /bin/sh +# Copyright (C) 2012 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/>. + +# An empty "foo_PRIMARY" declaration should cause "make install" to create +# directory $(foodir). Suggested in discussion on automake bug#10997. + +. ./defs || Exit 1 + +set -e + +echo AC_OUTPUT >> configure.ac + +cat > Makefile.am << 'END' +pkgdata_DATA = +libexec_SCRIPTS = +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +cwd=`pwd` +./configure --prefix="$cwd/inst" + +$MAKE install +test -d inst/share/$me +test -d inst/libexec +rm -rf inst + +$MAKE install-exec +test ! -d inst/share +test -d inst/libexec +rm -rf inst + +$MAKE install-data +test -d inst/share/$me +test ! -d inst/libexec +rm -rf inst + +./configure --prefix=/foo +$MAKE install DESTDIR=$cwd/dest +test -d dest/foo/share/$me +test -d dest/foo/libexec + +: diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk index b36d76cfe..7665db137 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -347,6 +347,7 @@ dist-missing-included-m4.test \ dist-missing-m4.test \ dist-readonly.test \ dist-repeated.test \ +dist-pr109765.test \ distcleancheck.test \ distcom2.test \ distcom3.test \ @@ -471,6 +472,8 @@ instdat.test \ instdat2.test \ instdir.test \ instdir2.test \ +instdir-cond.test \ +instdir-empty.test \ instdir-java.test \ instdir-lisp.test \ instdir-ltlib.test \ diff --git a/tests/python.test b/tests/python.test index 8a39f9f9c..2200d639f 100755 --- a/tests/python.test +++ b/tests/python.test @@ -14,7 +14,7 @@ # 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 py_compile is defined. +# Test to make sure py_compile and am__py_compile are correctly defined. . ./defs || Exit 1 @@ -24,6 +24,14 @@ cat > Makefile.am << 'END' python_PYTHON = foo.py END +cat > Makefile2.am << 'END' +python_PYTHON = a.py +nodist_python_PYTHON = b.py +nobase_python_PYTHON = x/c.py +mydir = ${prefix} +my_PYTHON = d.py +END + $ACLOCAL AUTOMAKE_fails @@ -33,4 +41,13 @@ $AUTOMAKE -a grep '^py_compile *=' Makefile.in test -f py-compile +$AUTOMAKE Makefile2 + +grep "py" Makefile.in Makefile2.in # For debugging. + +for f in Makefile.in Makefile2.in; do + test `grep -c '^py_compile =' $f` -eq 1 + test `grep -c '^am__py_compile =' $f` -eq 1 +done + : |