>From 463b6405380ac3ff266f980d30cfeeb55eb796ee Mon Sep 17 00:00:00 2001 Message-Id: From: Stefano Lattarini Date: Thu, 15 Mar 2012 09:00:12 +0100 Subject: [PATCH 1/2] 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 --- THANKS | 1 + tests/Makefile.am | 2 + tests/list-of-tests.mk | 1 + tests/python-pr10995.test | 60 +++++++++++++++++++++++++++++++++++++++++++++ tests/python.test | 11 ++++++- 5 files changed, 73 insertions(+), 2 deletions(-) create mode 100755 tests/python-pr10995.test diff --git a/THANKS b/THANKS index 418ad71..8363126 100644 --- a/THANKS +++ b/THANKS @@ -340,6 +340,7 @@ Stefano Lattarini address@hidden Stepan Kasal address@hidden Steve M. Robbins address@hidden Steve Goetze address@hidden +Steven Drake address@hidden Steven G. Johnson address@hidden Sven Verdoolaege address@hidden Tamara L. Dahlgren address@hidden diff --git a/tests/Makefile.am b/tests/Makefile.am index 9cac904..005a1de 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 0ee0711..b5a604c 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 0000000..1b94cf9 --- /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 e7a6984..fe9d593 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 -- 1.7.9