diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-03-15 09:00:12 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-03-15 09:00:12 +0100 |
commit | 463b6405380ac3ff266f980d30cfeeb55eb796ee (patch) | |
tree | fa5ec58c4918fb4e5ccee1f36d8875bd9942e429 | |
parent | 52ce42bbaf56e5eae76ea8f4fe1484c23c0fa10d (diff) | |
download | automake-463b6405380ac3ff266f980d30cfeeb55eb796ee.tar.gz |
python: expose automake bug#10995
* tests/python.test: Expose the bug in grepping tests.
* tests/python-noinst.test: New functional test to expose the
bug.
* tests/list-of-tests.mk: Add it.
* tests/Makefile.am (XFAIL_TESTS): Add the new test and the
extended one.
* THANKS: Update.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/list-of-tests.mk | 1 | ||||
-rwxr-xr-x | tests/python-pr10995.test | 60 | ||||
-rwxr-xr-x | tests/python.test | 11 |
5 files changed, 73 insertions, 2 deletions
@@ -340,6 +340,7 @@ Stefano Lattarini stefano.lattarini@gmail.com Stepan Kasal kasal@math.cas.cz Steve M. Robbins steve@nyongwa.montreal.qc.ca Steve Goetze goetze@dovetail.com +Steven Drake sbd@NetBSD.org Steven G. Johnson stevenj@alum.mit.edu Sven Verdoolaege skimo@kotnet.org Tamara L. Dahlgren dahlgren1@llnl.gov diff --git a/tests/Makefile.am b/tests/Makefile.am index 9cac904a1..005a1def1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -30,6 +30,8 @@ java-nobase.test \ objext-pr10128.test \ pr8365-remake-timing.test \ lex-subobj-nodep.test \ +python.test \ +python-pr10995.test \ remake-am-pr10111.test \ remake-m4-pr10111.test \ txinfo5.test diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk index 0ee07117f..b5a604cd0 100644 --- a/tests/list-of-tests.mk +++ b/tests/list-of-tests.mk @@ -728,6 +728,7 @@ python9.test \ python10.test \ python11.test \ python12.test \ +python-pr10995.test \ recurs.test \ recurs2.test \ remake.test \ diff --git a/tests/python-pr10995.test b/tests/python-pr10995.test new file mode 100755 index 000000000..1b94cf931 --- /dev/null +++ b/tests/python-pr10995.test @@ -0,0 +1,60 @@ +#! /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/>. + +# Test automake bug#10995: am__py_compile doesn't get correctly defined +# when there a 'noinst_PYTHON' declaration precedes a 'foo_PYTHON' +# declaration. + +required=python +. ./defs || Exit 1 + +set -e + +cat >>configure.in <<'EOF' +AM_PATH_PYTHON +AC_OUTPUT +EOF + +cat > Makefile.am <<'END' +yesinstdir = $(prefix)/py +noinst_PYTHON = no.py +yesinst_PYTHON = yes.py +disttest: distdir + test -f $(distdir)/no.py + test -f $(distdir)/yes.py +END + +echo 'def foo(): return 1' > yes.py +# no.py shouldn't be byte-compiled, so lets make it syntactically invalid. +echo 'if' > no.py + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing +test -f py-compile + +inst=`pwd`/inst + +./configure --prefix="$inst" +$MAKE install +test -f "$inst/py/yes.py" +test -f "$inst/py/yes.pyc" +test ! -f "$inst/py/no.py" +test ! -f "$inst/py/no.pyc" + +$MAKE disttest + +: diff --git a/tests/python.test b/tests/python.test index e7a69847d..fe9d5939a 100755 --- a/tests/python.test +++ b/tests/python.test @@ -34,16 +34,23 @@ mydir = ${prefix} my_PYTHON = d.py END +# For automake bug#10995. +cat > Makefile3.am << 'END' +noinst_PYTHON = un.py +python_PYTHON = in.py +END + $ACLOCAL $AUTOMAKE -a test -f py-compile $AUTOMAKE Makefile2 +$AUTOMAKE Makefile3 -grep "py" Makefile.in Makefile2.in # For debugging. +grep "py" Makefile.in Makefile2.in Makefile3.in # For debugging. -for f in Makefile.in Makefile2.in; do +for f in Makefile.in Makefile2.in Makefile3.in; do test `grep -c '^py_compile =' $f` -eq 1 test `grep -c '^am__py_compile =' $f` -eq 1 done |