From: Stefano Lattarini Date: Thu, 15 Mar 2012 08:00:12 +0000 (+0100) Subject: python: expose automake bug#10995 X-Git-Tag: v1.11.3b~7^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=463b6405380ac3ff266f980d30cfeeb55eb796ee;p=thirdparty%2Fautomake.git 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 --- diff --git a/THANKS b/THANKS index 418ad719c..83631268b 100644 --- a/THANKS +++ b/THANKS @@ -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 . + +# 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