From 370e5775c20872a8f2b5c1e520b31dc1544b9cd8 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 9 Mar 2012 21:35:04 +0100 Subject: coverage: expose automake bug#10975 * tests/dist-pr10975.test: New test. * tests/list-of-tests.mk: Add it. * tests/Makefile.am (XFAIL_TESTS): Likewise. --- tests/Makefile.am | 1 + tests/dist-pr109765.test | 44 ++++++++++++++++++++++++++++++++++++++++++++ tests/list-of-tests.mk | 1 + 3 files changed, 46 insertions(+) create mode 100755 tests/dist-pr109765.test (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index d909942db..b8ede3086 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -23,6 +23,7 @@ auxdir2.test \ cond17.test \ dist-auxfile.test \ dist-auxfile-2.test \ +dist-pr109765.test \ gcj6.test \ java-nobase.test \ objext-pr10128.test \ diff --git a/tests/dist-pr109765.test b/tests/dist-pr109765.test new file mode 100755 index 000000000..d656d56f9 --- /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 . + +# 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.in +: > 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/list-of-tests.mk b/tests/list-of-tests.mk index 420b56bf8..023bf3bc6 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -332,6 +332,7 @@ dist-included-parent-dir.test \ dist-missing-am.test \ dist-missing-included-m4.test \ dist-missing-m4.test \ +dist-pr109765.test \ distcleancheck.test \ distcom2.test \ distcom3.test \ -- cgit v1.2.1 From b153660787dd7dea409ad969c29393c105e13bf2 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Mon, 12 Mar 2012 11:46:04 +0100 Subject: coverage: expose automake bug#10997 * tests/instdir-cond.test: New test. * tests/list-of-tests.mk: Add it. * tests/Makefile.am (XFAIL_TESTS): Likewise. Copyright-paperwork-exempt: yes Signed-off-by: Stefano Lattarini --- tests/Makefile.am | 1 + tests/instdir-cond.test | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/list-of-tests.mk | 1 + 3 files changed, 51 insertions(+) create mode 100644 tests/instdir-cond.test (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index b8ede3086..9cac904a1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -25,6 +25,7 @@ dist-auxfile.test \ dist-auxfile-2.test \ dist-pr109765.test \ gcj6.test \ +instdir-cond.test \ java-nobase.test \ objext-pr10128.test \ pr8365-remake-timing.test \ diff --git a/tests/instdir-cond.test b/tests/instdir-cond.test new file mode 100644 index 000000000..8d83f8826 --- /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 . + +# Check against automake bug#10997: directories holding only +# conditionally-installed files should not be created unconditionally. + +. ./defs || Exit 1 + +set -e + +cat >> configure.in << '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/list-of-tests.mk b/tests/list-of-tests.mk index 023bf3bc6..7fd037673 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -459,6 +459,7 @@ instdat.test \ instdat2.test \ instdir.test \ instdir2.test \ +instdir-cond.test \ instdir-java.test \ instdir-lisp.test \ instdir-ltlib.test \ -- cgit v1.2.1 From 650dba0873f6c894461ce29cb26a1b3104287d24 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Mon, 12 Mar 2012 12:15:47 +0100 Subject: coverage: make sure am__py_compile is defined when needed See automake bug#10995. * tests/python.test: Also make sure 'am__py_compile' is defined correctly in the generated Makefile.in. Signed-off-by: Stefano Lattarini --- tests/python.test | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/python.test b/tests/python.test index 8102ca002..e7a69847d 100755 --- a/tests/python.test +++ b/tests/python.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 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 @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Test to make sure py_compile is defined. +# Test to make sure py_compile and am__py_compile are correctly defined. . ./defs || Exit 1 @@ -26,8 +26,26 @@ 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 -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 + +: -- cgit v1.2.1 From e9927ea32d8fe5056123b021ff771cb906b1b3df Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Mon, 12 Mar 2012 14:41:04 +0100 Subject: coverage: an empty foo_PRIMARY should create directory $(foodir) For example, a Makefile.am containing the definition: pkgdata_DATA = should cause the 'install' rule of the generated Makefile.in to create the '$(pkgdatadir)' directory (respecting any DESTDIR setting as well). Suggestion by Peter Breitenlohner in automake bug#10997. Signed-off-by: Stefano Lattarini --- tests/instdir-empty.test | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/list-of-tests.mk | 1 + 2 files changed, 59 insertions(+) create mode 100644 tests/instdir-empty.test (limited to 'tests') diff --git a/tests/instdir-empty.test b/tests/instdir-empty.test new file mode 100644 index 000000000..f69958349 --- /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 . + +# 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.in + +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 7fd037673..0ee07117f 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -460,6 +460,7 @@ instdat2.test \ instdir.test \ instdir2.test \ instdir-cond.test \ +instdir-empty.test \ instdir-java.test \ instdir-lisp.test \ instdir-ltlib.test \ -- cgit v1.2.1 From 52ce42bbaf56e5eae76ea8f4fe1484c23c0fa10d Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Sat, 10 Mar 2012 08:49:55 +0100 Subject: tests: avoid spurious failures in get-sysconf.test This change fixes the last bit of automake bug#10866. * tests/get-sysconf.test: When Homebrew spawns a build, even if from a project's VCS, it stages the files in a new temporary directory, instead of building directly from a VCS checkout. This behaviour was causing a spurious failure in this test, which expected to find either a ChangeLog file or a .git directory in the source directory (the former happening when the test was run from a distribution tarball, the latter when it was run from a git checkout). The Homebrew issue shows that these expectations are not truly warranted, so relax the test to just give a warning, not a failure, in case they do not hold. Since we are at it, fix an unrelated weakness in the displaying of the git log, which could have failed when the builddir was not a subdirectory of the srcdir. Signed-off-by: Stefano Lattarini --- tests/get-sysconf.test | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/get-sysconf.test b/tests/get-sysconf.test index bad4735d9..cbcf07698 100755 --- a/tests/get-sysconf.test +++ b/tests/get-sysconf.test @@ -32,16 +32,21 @@ top_testbuilddir=`(cd $testbuilddir/.. && pwd)` 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 cat "$top_testbuilddir/config.log" || st=1 -- cgit v1.2.1