automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-700-


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-700-g0fc7e23
Date: Thu, 10 Feb 2011 09:36:56 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=0fc7e23fe9fb5fcebfb22ff56d5c64c9030b3dc3

The branch, master has been updated
       via  0fc7e23fe9fb5fcebfb22ff56d5c64c9030b3dc3 (commit)
       via  6d0cfa312e825753c07fbd00aa0da5810302465f (commit)
       via  5ed043ad03d36be44500501ec0d69f3ba736911d (commit)
       via  6366a170d89eaaf6c3f119dc999035eb7d5a5800 (commit)
       via  e12be9450726e26136a6bc64f7df47ced18f6671 (commit)
       via  9095d6b98f6d9d3755e8b592f336011aef11d61f (commit)
       via  57198decf1d0dfa758d70ac564e2aec4281798d0 (commit)
       via  06b46e1f8f307d2f6d0af6a9d73f7003171d0745 (commit)
      from  c383211ab93ae36b3d9485da4101852db74ce0cc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0fc7e23fe9fb5fcebfb22ff56d5c64c9030b3dc3
Merge: 6d0cfa3 5ed043a
Author: Stefano Lattarini <address@hidden>
Date:   Thu Feb 10 10:32:51 2011 +0100

    Merge branch 'maint'

commit 6d0cfa312e825753c07fbd00aa0da5810302465f
Merge: c383211 6366a17
Author: Stefano Lattarini <address@hidden>
Date:   Thu Feb 10 10:13:59 2011 +0100

    Merge branch 'python-tests-extend'
    
    Conflicts:
        tests/Makefile.am
        tests/Makefile.in
        tests/python11.test
        tests/python2.test
        tests/python8.test
        tests/python9.test

commit 6366a170d89eaaf6c3f119dc999035eb7d5a5800
Author: Stefano Lattarini <address@hidden>
Date:   Tue Feb 1 23:22:08 2011 +0100

    python: extend and improve tests, fix minor glitches
    
    * m4/python.m4 (AM_PATH_PYTHON): Ensure the "checking ..." messages
    from configure are always complete, even in case of failure.  Tiny
    cosmetic improvement in info/error messages.
    * tests/python.test: Also check that automake complains if the
    PYTHON primary is used but the `py-compile' script is not present.
    Make grepping of generated Makefile.in laxer w.r.t. whitespace.
    Add trailing `:' command.
    * tests/python2.test: Remove repeated calls aclocal: they are
    useless because configure.in is never modified.  Make grepping
    of automake stderr more comprehensive.  Remove the pre-existing
    `py-compile' file before trying to install it with `--add-missing'.
    Add trailing `:' command.
    * tests/python3.test: Add trailing `:' command.
    * tests/python11.test: Likewise.
    * tests/python4.test: Likewise.  Also, try to pass PYTHON config
    variable to configure from the environment, rather than only from
    the command line.
    * tests/python5.test: Ensure that the "checking ..." messages from
    configure are always complete.  Use proper m4 quoting.  Add a
    trailing `:' command.
    * tests/python6.test: Simplify test logic, by checking for files
    created by configure rather then grepping its output.
    * tests/python7.test: Likewise.
    * tests/python8.test: Also check that `$PYTHON' is meaningfully
    set in the ACTION-IF-TRUE argument of AM_PATH_PYTHON.
    * tests/python9.test: Likewise.
    * tests/python10.test: Add trailing `:' command.
    (Makefile.am): Declare `disttest' target as `.PHONY', and add
    an `ls -l' to its recipe, for debugging.
    * tests/nobase-python.test: In testing "make uninstall" and
    "make install" results, prefer idioms that make verbose logs
    more helpful.  Remove a couple of lines of dead code.  Add a
    trailing `:' command.
    * tests/python5b.test: New test, checking that configure performs
    the check on the python version even when the choice of the python
    interpreter is forced by the user.
    * tests/python-dist.test: New test, checking the distribution of
    *_PYTHON files.
    * tests/python-vars.test: New test, checking that AM_PATH_PYTHON
    correctly set all the output variables advertised in the manual.
    * tests/python-virtualenv.test: New test, checking that python
    support offered by automake works well with "virtual python
    environments" created by the `virtualenv' program.
    * tests/instdir-prog.test: Also check `$(pyexecdir)'.  Existing
    checks made slightly stricter.
    * tests/instdir-prog.test: Also check `$(pyexecdir)'.  Existing
    * tests/instdir-ltlib.test: Likewise.
    * tests/Makefile.am (TESTS): Update.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   86 +++++++++
 doc/automake.texi                                  |    6 +
 m4/python.m4                                       |    5 +-
 tests/Makefile.am                                  |    8 +
 tests/Makefile.in                                  |   27 ++-
 ...t-stamp-vti.test => check-exported-srcdir.test} |   55 ++++---
 tests/check-tests-in-builddir.test                 |   83 +++++++++
 .../{check11.test => check-tests_environment.test} |   24 ++--
 tests/instdir-ltlib.test                           |   24 ++-
 tests/instdir-prog.test                            |   24 ++-
 tests/lflags.test                                  |    4 +
 tests/lflags2.test                                 |    4 +
 tests/nobase-python.test                           |   10 +-
 tests/{check6.test => parallel-tests-subdir.test}  |   35 ++--
 tests/python-dist.test                             |   80 +++++++++
 tests/python-vars.test                             |   93 ++++++++++
 tests/python-virtualenv.test                       |  183 ++++++++++++++++++++
 tests/python.test                                  |    9 +-
 tests/python10.test                                |    4 +
 tests/python11.test                                |    4 +-
 tests/python2.test                                 |   16 +-
 tests/python3.test                                 |    2 +
 tests/python4.test                                 |    9 +-
 tests/python5.test                                 |   12 +-
 tests/{python5.test => python5b.test}              |   32 +++-
 tests/python6.test                                 |    9 +-
 tests/python7.test                                 |    7 +-
 tests/python8.test                                 |   10 +-
 tests/python9.test                                 |   12 +-
 29 files changed, 755 insertions(+), 122 deletions(-)
 copy tests/{autodist-stamp-vti.test => check-exported-srcdir.test} (56%)
 create mode 100755 tests/check-tests-in-builddir.test
 copy tests/{check11.test => check-tests_environment.test} (70%)
 copy tests/{check6.test => parallel-tests-subdir.test} (66%)
 create mode 100755 tests/python-dist.test
 create mode 100755 tests/python-vars.test
 create mode 100755 tests/python-virtualenv.test
 copy tests/{python5.test => python5b.test} (64%)

diff --git a/ChangeLog b/ChangeLog
index 18567c6..95aa6a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,89 @@
+2011-02-06  Stefano Lattarini  <address@hidden>
+
+       tests: tweak few tests on simple and parallel test drivers
+       * tests/check-exported-srcdir.test: Improve heading comments.
+       * tests/check-tests-in-builddir.test: Likewise.  Also, unset the
+       `FOO_EXIT_STATUS' variable, so that any pre-existing value in the
+       environment won't risk to interfere with the test.
+       Suggestions by Ralf Wildenhues.
+
+2011-02-06  Stefano Lattarini  <address@hidden>
+
+       python: extend and improve tests, fix minor glitches
+       * m4/python.m4 (AM_PATH_PYTHON): Ensure the "checking ..." messages
+       from configure are always complete, even in case of failure.  Tiny
+       cosmetic improvement in info/error messages.
+       * tests/python.test: Also check that automake complains if the
+       PYTHON primary is used but the `py-compile' script is not present.
+       Make grepping of generated Makefile.in laxer w.r.t. whitespace.
+       Add trailing `:' command.
+       * tests/python2.test: Remove repeated calls aclocal: they are
+       useless because configure.in is never modified.  Make grepping
+       of automake stderr more comprehensive.  Remove the pre-existing
+       `py-compile' file before trying to install it with `--add-missing'.
+       Add trailing `:' command.
+       * tests/python3.test: Add trailing `:' command.
+       * tests/python11.test: Likewise.
+       * tests/python4.test: Likewise.  Also, try to pass PYTHON config
+       variable to configure from the environment, rather than only from
+       the command line.
+       * tests/python5.test: Ensure that the "checking ..." messages from
+       configure are always complete.  Use proper m4 quoting.  Add a
+       trailing `:' command.
+       * tests/python6.test: Simplify test logic, by checking for files
+       created by configure rather then grepping its output.
+       * tests/python7.test: Likewise.
+       * tests/python8.test: Also check that `$PYTHON' is meaningfully
+       set in the ACTION-IF-TRUE argument of AM_PATH_PYTHON.
+       * tests/python9.test: Likewise.
+       * tests/python10.test: Add trailing `:' command.
+       (Makefile.am): Declare `disttest' target as `.PHONY', and add
+       an `ls -l' to its recipe, for debugging.
+       * tests/nobase-python.test: In testing "make uninstall" and
+       "make install" results, prefer idioms that make verbose logs
+       more helpful.  Remove a couple of lines of dead code.  Add a
+       trailing `:' command.
+       * tests/python5b.test: New test, checking that configure performs
+       the check on the python version even when the choice of the python
+       interpreter is forced by the user.
+       * tests/python-dist.test: New test, checking the distribution of
+       *_PYTHON files.
+       * tests/python-vars.test: New test, checking that AM_PATH_PYTHON
+       correctly set all the output variables advertised in the manual.
+       * tests/python-virtualenv.test: New test, checking that python
+       support offered by automake works well with "virtual python
+       environments" created by the `virtualenv' program.
+       * tests/instdir-prog.test: Also check `$(pyexecdir)'.  Existing
+       checks made slightly stricter.
+       * tests/instdir-prog.test: Also check `$(pyexecdir)'.  Existing
+       * tests/instdir-ltlib.test: Likewise.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-02-01  Stefano Lattarini  <address@hidden>
+
+       coverage: more tests on simple and parallel test drivers
+       * tests/parallel-tests-subdir.test: New test.
+       * tests/check-exported-srcdir.test: Likewise.
+       * tests/check-tests-in-builddir.test: Likewise.
+       * tests/check-tests_environment.test: Likewise.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-01-29  Stefano Lattarini  <address@hidden>
+
+       tests: fix spurious failures in lflags*.test
+       * tests/lflags.test: Remove 'LEX' from the environment, so
+       that it won't be erroneously picked up by `make -e'.
+       * tests/lflags2.test: Likewise.
+
+2011-01-24  Stefano Lattarini  <address@hidden>
+
+       docs: color-tests issues with parallel make
+       * doc/automake.texi (Simple Tests): Document that automatic
+       recognition of a capable terminal attached to stdout can fail
+       with some make implementation when running in parallel mode,
+       thus causing colored test output not to be automatically
+       activated when it should.
+
 2011-01-23  Stefano Lattarini  <address@hidden>
 
        coverage: test semantics of "dummy" per-target flags
diff --git a/doc/automake.texi b/doc/automake.texi
index 3af5201..b86b565 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8631,6 +8631,12 @@ colored output by setting the @command{make} variable
 @samp{AM_COLOR_TESTS=no}, or force colored output even without a connecting
 terminal with @samp{AM_COLOR_TESTS=always}.
 
+Note that the semantics of some @command{make} implementations when used
+in parallel mode (@pxref{Parallel make,,, autoconf, The Autoconf Manual})
+can cause the automatic detection of a connection to a capable terminal
+to fail.  In that case, you can still resort to the use of
address@hidden
+
 @vindex TESTS
 @vindex TESTS_ENVIRONMENT
 The variable @code{TESTS_ENVIRONMENT} can be used to set environment
diff --git a/m4/python.m4 b/m4/python.m4
index 50e1538..c341d5c 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -51,10 +51,11 @@ AC_DEFUN([AM_PATH_PYTHON],
     dnl A version check is needed.
     if test -n "$PYTHON"; then
       # If the user set $PYTHON, use it and don't search something else.
-      AC_MSG_CHECKING([whether $PYTHON version >= $1])
+      AC_MSG_CHECKING([whether $PYTHON version is >= $1])
       AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
                              [AC_MSG_RESULT(yes)],
-                             [AC_MSG_ERROR(too old)])
+                             [AC_MSG_RESULT(no)
+                              AC_MSG_ERROR(Python interpreter is too old)])
       am_display_PYTHON=$PYTHON
     else
       # Otherwise, try each interpreter until we find one that satisfies
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f53a1f3..2b5909d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -217,6 +217,9 @@ check9.test \
 check10.test \
 check11.test \
 check12.test \
+check-exported-srcdir.test \
+check-tests-in-builddir.test \
+check-tests_environment.test \
 checkall.test \
 clean.test \
 clean2.test \
@@ -682,6 +685,7 @@ parallel-tests8.test \
 parallel-tests9.test \
 parallel-tests10.test \
 parallel-tests-unreadable-log.test \
+parallel-tests-subdir.test \
 parse.test \
 percent.test \
 percent2.test \
@@ -739,6 +743,7 @@ python2.test \
 python3.test \
 python4.test \
 python5.test \
+python5b.test \
 python6.test \
 python7.test \
 python8.test \
@@ -746,6 +751,9 @@ python9.test \
 python10.test \
 python11.test \
 python12.test \
+python-dist.test \
+python-vars.test \
+python-virtualenv.test \
 recurs.test \
 recurs2.test \
 remake.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index b78e5a5..1e903f4 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -287,13 +287,15 @@ EXTRA_DIST = ChangeLog-old gen-parallel-tests 
instspc-tests.sh \
 XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test \
        override-conditional-2.test txinfo5.test \
        $(instspc_xfail_tests)
-parallel_tests = backcompat5-p.test check-p.test check10-p.test \
-       check11-p.test check12-p.test check2-p.test check3-p.test \
-       check4-p.test check5-p.test check6-p.test check7-p.test \
-       check8-p.test check9-p.test color-p.test color2-p.test \
-       comment9-p.test dejagnu-p.test exeext4-p.test maken3-p.test \
-       maken4-p.test posixsubst-tests-p.test pr401-p.test \
-       pr401b-p.test pr401c-p.test
+parallel_tests = backcompat5-p.test check-exported-srcdir-p.test \
+       check-tests-in-builddir-p.test check-tests_environment-p.test \
+       check-p.test check10-p.test check11-p.test check12-p.test \
+       check2-p.test check3-p.test check4-p.test check5-p.test \
+       check6-p.test check7-p.test check8-p.test check9-p.test \
+       color-p.test color2-p.test comment9-p.test dejagnu-p.test \
+       exeext4-p.test maken3-p.test maken4-p.test \
+       posixsubst-tests-p.test pr401-p.test pr401b-p.test \
+       pr401c-p.test
 instspc_tests = instspc-squote-build.test instspc-squote-install.test \
        instspc-dquote-build.test instspc-dquote-install.test \
        instspc-bquote-build.test instspc-bquote-install.test \
@@ -480,6 +482,9 @@ check9.test \
 check10.test \
 check11.test \
 check12.test \
+check-exported-srcdir.test \
+check-tests-in-builddir.test \
+check-tests_environment.test \
 checkall.test \
 clean.test \
 clean2.test \
@@ -945,6 +950,7 @@ parallel-tests8.test \
 parallel-tests9.test \
 parallel-tests10.test \
 parallel-tests-unreadable-log.test \
+parallel-tests-subdir.test \
 parse.test \
 percent.test \
 percent2.test \
@@ -1002,6 +1008,7 @@ python2.test \
 python3.test \
 python4.test \
 python5.test \
+python5b.test \
 python6.test \
 python7.test \
 python8.test \
@@ -1009,6 +1016,9 @@ python9.test \
 python10.test \
 python11.test \
 python12.test \
+python-dist.test \
+python-vars.test \
+python-virtualenv.test \
 recurs.test \
 recurs2.test \
 remake.test \
@@ -1579,6 +1589,9 @@ uninstall-am:
        pdf-am ps ps-am recheck recheck-html uninstall uninstall-am
 
 backcompat5-p.log: backcompat5.test
+check-exported-srcdir-p.log: check-exported-srcdir.test
+check-tests-in-builddir-p.log: check-tests-in-builddir.test
+check-tests_environment-p.log: check-tests_environment.test
 check-p.log: check.test
 check10-p.log: check10.test
 check11-p.log: check11.test
diff --git a/tests/autodist-stamp-vti.test b/tests/check-exported-srcdir.test
similarity index 56%
copy from tests/autodist-stamp-vti.test
copy to tests/check-exported-srcdir.test
index 4f37e14..dc02b22 100755
--- a/tests/autodist-stamp-vti.test
+++ b/tests/check-exported-srcdir.test
@@ -14,47 +14,52 @@
 # 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 that `stamp-vti' is automatically distributed when info_TEXINFOS
-# and version.texi are involved.
-# Related to automake bug#7819.
+# Check that the testsuite driver (either with or without the
+# parallel-tests option enabled) exports the `srcdir' value in the
+# environment of the tests.  This is documented in the manual.
 
-required=makeinfo
 . ./defs || Exit 1
 
 set -e
 
-cat >> configure.in << END
+show_info ()
+{
+  if test x"$parallel_tests" = x"yes"; then
+     cat foo.log
+     cat test-suite.log
+  else
+     :
+  fi
+}
+
+mkdir SrcDir BuildDir
+
+mv [a-z]* SrcDir
+cd SrcDir
+
+cat >> configure.in << 'END'
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-info_TEXINFOS = foo.texi
-.PHONY: test
-test: all distdir
-       ls -l $(distdir)
-       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]stamp-vti '
-       test -f $(distdir)/stamp-vti
+TESTS = foo.test
 END
 
-cat > foo.texi << 'END'
-\input texinfo
address@hidden foo.info
address@hidden Zardoz
address@hidden Top
address@hidden version.texi
-bar baz quux
address@hidden
+cat > foo.test <<'END'
+#!/bin/sh
+echo "foo.test: srcdir='$srcdir'"
+test x"$srcdir" = x"../SrcDir"
 END
-
-# Required when using Texinfo.
-: > texinfo.tex
-cp "$testsrcdir/../lib/mdate-sh" .
+chmod a+x foo.test
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure
-$MAKE test
+cd ../BuildDir
+../SrcDir/configure
+
+$MAKE check || { show_info; Exit 1; }
+show_info
 
 :
diff --git a/tests/check-tests-in-builddir.test 
b/tests/check-tests-in-builddir.test
new file mode 100755
index 0000000..2d0e423
--- /dev/null
+++ b/tests/check-tests-in-builddir.test
@@ -0,0 +1,83 @@
+#! /bin/sh
+# Copyright (C) 2011 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 that the testsuite driver can find test in the srcdir as
+# well as in builddir, and that is prefers those in the builddir.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+TESTS = foo.test bar.test
+EXTRA_DIST = $(TESTS)
+END
+
+cat > foo.test << 'END'
+#! /bin/sh
+exit ${FOO_EXIT_STATUS-0}
+END
+chmod a+x foo.test
+
+unset FOO_EXIT_STATUS || :
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+mkdir build
+cd build
+
+../configure
+
+cat > bar.test << 'END'
+#! /bin/sh
+exit 0
+END
+chmod a+x bar.test
+
+$MAKE check >out 2>&1 || { cat out; Exit1; }
+cat out
+grep '\.\./foo' out && Exit 1
+grep '^PASS: foo.test *$' out
+grep '^PASS: bar.test *$' out
+
+rm -f test-suite.log foo.log bar.log
+
+FOO_EXIT_STATUS=1 $MAKE check >out 2>&1 && { cat out; Exit1; }
+cat out
+grep '\.\./foo' out && Exit 1
+grep '^FAIL: foo.test *$' out
+grep '^PASS: bar.test *$' out
+
+rm -f test-suite.log foo.log bar.log
+
+# Check that if the same test is present in srcdir and builddir,
+# the one in builddir is preferred.
+cp bar.test foo.test
+FOO_EXIT_STATUS=1 $MAKE check >out 2>&1 || { cat out; Exit1; }
+cat out
+grep '^PASS: foo.test *$' out
+grep '^PASS: bar.test *$' out
+
+# The tests in the builddir must be preferred also by "make dist".
+FOO_EXIT_STATUS=1 $MAKE distcheck
+
+:
diff --git a/tests/check11.test b/tests/check-tests_environment.test
similarity index 70%
copy from tests/check11.test
copy to tests/check-tests_environment.test
index 912b619..a07ab95 100755
--- a/tests/check11.test
+++ b/tests/check-tests_environment.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011 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,36 +14,34 @@
 # 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 skip summary.
+# "Simple Tests" testsuite driver: check TESTS_ENVIRONMENT support.
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-TESTS = skip skip2
+TESTS = foo.test
+EXTRA_DIST = $(TESTS)
 END
 
-cat >>skip <<'END'
+cat > foo.test << 'END'
 #! /bin/sh
-exit 77
+test x"$FOO" = x"ok"
 END
-chmod a+x skip
-cp skip skip2
+chmod a+x foo.test
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
 ./configure
-env TESTS=skip $MAKE -e check >stdout
-cat stdout
-grep '1.*passed' stdout && Exit 1
 
-env TESTS="skip skip2" $MAKE -e check >stdout
-cat stdout
-grep '2.*passed' stdout && Exit 1
+FOO=bad TESTS_ENVIRONMENT='FOO=ok'  $MAKE check
+FOO=ok  TESTS_ENVIRONMENT='FOO=bad' $MAKE check && Exit 1
 
 :
diff --git a/tests/instdir-ltlib.test b/tests/instdir-ltlib.test
index ec25bde..a90536d 100755
--- a/tests/instdir-ltlib.test
+++ b/tests/instdir-ltlib.test
@@ -14,7 +14,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# If $(libdir) is the empty string, then nothing should be installed there.
+# If $(libdir) or $(pyexecdir) is the empty string, then nothing should
+# be installed there.
 # This test exercises the libtool code paths.
 
 required=libtoolize
@@ -24,6 +25,7 @@ cat >>configure.in <<'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_LIBTOOL
+AM_PATH_PYTHON
 AC_OUTPUT
 END
 
@@ -35,6 +37,8 @@ bin_PROGRAMS = p
 nobase_bin_PROGRAMS = np sub/np
 lib_LTIBRARIES = libfoo.la
 nobase_lib_LTLIBRARIES = libnfoo.la sub/libnfoo.la
+pyexec_LTIBRARIES = libpy.la
+nobase_pyexec_LTLIBRARIES = libnpy.la sub/libnpy.la
 END
 
 cat >p.c <<'END'
@@ -45,6 +49,9 @@ cp p.c sub/np.c
 cp p.c libfoo.c
 cp p.c libnfoo.c
 cp p.c sub/libnfoo.c
+cp p.c libpy.c
+cp p.c libnpy.c
+cp p.c sub/libnpy.c
 
 libtoolize
 $ACLOCAL
@@ -55,11 +62,13 @@ instdir=`pwd`/inst
 destdir=`pwd`/dest
 mkdir build
 cd build
-../configure --prefix="$instdir"
+../configure --prefix="$instdir" PYTHON="echo" \
+             am_cv_python_pythondir="$instdir/python" \
+             am_cv_python_pyexecdir="$instdir/pyexec"
 $MAKE
 
-bindir= libdir=
-export bindir libdir
+bindir= libdir= pyexecdir=
+export bindir libdir pyexecdir
 $MAKE -e install
 test ! -d "$instdir"
 $MAKE -e install DESTDIR="$destdir"
@@ -67,6 +76,9 @@ test ! -d "$instdir"
 test ! -d "$destdir"
 $MAKE -e uninstall > stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'rm -f' stdout && Exit 1
-$MAKE -e uninstall DESTDIR="$destdir"
+grep 'rm ' stdout && Exit 1
+$MAKE -e uninstall DESTDIR="$destdir" > stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'rm ' stdout && Exit 1
+
 :
diff --git a/tests/instdir-prog.test b/tests/instdir-prog.test
index b5b150f..eb52933 100755
--- a/tests/instdir-prog.test
+++ b/tests/instdir-prog.test
@@ -14,7 +14,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# If $(bindir) is the empty string, then nothing should be installed there.
+# If $(bindir), $(libdir) or $(pyexecdir) is the empty string, then
+# nothing should be installed there.
 # This test exercises the prog and libs code paths.
 
 . ./defs || Exit 1
@@ -23,6 +24,7 @@ cat >>configure.in <<'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_RANLIB
+AM_PATH_PYTHON
 AC_OUTPUT
 END
 
@@ -34,6 +36,8 @@ bin_PROGRAMS = p
 nobase_bin_PROGRAMS = np sub/np
 lib_LIBRARIES = libfoo.a
 nobase_lib_LIBRARIES = libnfoo.a sub/libnfoo.a
+pyexec_PROGRAMS = py
+nobase_pyexec_PROGRAMS = npy sub/npy
 END
 
 cat >p.c <<'END'
@@ -44,6 +48,9 @@ cp p.c sub/np.c
 cp p.c libfoo.c
 cp p.c libnfoo.c
 cp p.c sub/libnfoo.c
+cp p.c py.c
+cp p.c npy.c
+cp p.c sub/npy.c
 
 $ACLOCAL
 $AUTOCONF
@@ -53,11 +60,13 @@ instdir=`pwd`/inst
 destdir=`pwd`/dest
 mkdir build
 cd build
-../configure --prefix="$instdir"
+../configure --prefix="$instdir" PYTHON="echo" \
+             am_cv_python_pythondir="$instdir/python" \
+             am_cv_python_pyexecdir="$instdir/pyexec"
 $MAKE
 
-bindir= libdir=
-export bindir libdir
+bindir= libdir= pyexecdir=
+export bindir libdir pyexecdir
 $MAKE -e install
 test ! -d "$instdir"
 $MAKE -e install DESTDIR="$destdir"
@@ -65,6 +74,9 @@ test ! -d "$instdir"
 test ! -d "$destdir"
 $MAKE -e uninstall > stdout || { cat stdout; Exit 1; }
 cat stdout
-grep 'rm -f' stdout && Exit 1
-$MAKE -e uninstall DESTDIR="$destdir"
+grep 'rm ' stdout && Exit 1
+$MAKE -e uninstall DESTDIR="$destdir" > stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'rm ' stdout && Exit 1
+
 :
diff --git a/tests/lflags.test b/tests/lflags.test
index a725c5c..da207fb 100755
--- a/tests/lflags.test
+++ b/tests/lflags.test
@@ -28,6 +28,10 @@ echo 'extern int dummy;' >> lex.yy.c
 END
 chmod a+x fake-lex
 
+# Remove Lex from the environment, so that it won't interfere
+# with `make -e' below.
+unset LEX || :
+
 cat >> configure.in <<'END'
 AC_PROG_CC
 # Simulate presence of Lex using our fake-lex script.
diff --git a/tests/lflags2.test b/tests/lflags2.test
index 39f8a97..9e339f3 100755
--- a/tests/lflags2.test
+++ b/tests/lflags2.test
@@ -29,6 +29,10 @@ echo 'extern int dummy;' >> lex.yy.c
 END
 chmod a+x fake-lex
 
+# Remove Lex from the environment, so that it won't interfere
+# with `make -e' below.
+unset LEX || :
+
 cat >> configure.in <<'END'
 AC_PROG_CXX
 # Simulate presence of Lex using our fake-lex script.
diff --git a/tests/nobase-python.test b/tests/nobase-python.test
index 5ff170e..c869b85 100755
--- a/tests/nobase-python.test
+++ b/tests/nobase-python.test
@@ -30,6 +30,7 @@ my_PYTHON = one.py sub/base.py
 nobase_my_PYTHON = two.py sub/nobase.py
 
 test-install-data: install-data
+       find inst -print; : for debugging
        test   -f inst/my/one.py
        test   -f inst/my/one.pyc
        test   -f inst/my/two.py
@@ -53,16 +54,13 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-mkdir inst
-inst=`pwd`/inst
-
 ./configure --prefix "`pwd`/inst" --program-prefix=p
 
 $MAKE
 $MAKE test-install-data
 $MAKE uninstall
 
-test `find inst/my -type f -print | wc -l` = 0
+find inst/my -type f -print | grep . && Exit 1
 
 $MAKE install-strip
 
@@ -76,4 +74,6 @@ cd build
 $MAKE
 $MAKE test-install-data
 $MAKE uninstall
-test `find inst/my -type f -print | wc -l` = 0
+find inst/my -type f -print | grep . && Exit 1
+
+:
diff --git a/tests/check6.test b/tests/parallel-tests-subdir.test
similarity index 66%
copy from tests/check6.test
copy to tests/parallel-tests-subdir.test
index b3ba9d8..18695fe 100755
--- a/tests/check6.test
+++ b/tests/parallel-tests-subdir.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011 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,39 +14,38 @@
 # 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 for PR 400: XFAIL_TESTS delimited by TABs.
-# Also test that Solaris make VPATH rewriting is honored
+# Check that the parallel-tests driver creates parent directories for
+# the log files when needed.
 
+parallel_tests=yes
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
-AC_PROG_CC
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-TESTS = $(XFAIL_TESTS)
-XFAIL_TESTS = a        b       c
-END
-
-cat >>a <<'END'
-#! /bin/sh
-exit 1
+TESTS = dir1/foo.test dir2/dir3/foo.test
+TEST_LOG_COMPILER = sh
 END
 
-cp a b
-cp a c
-
-chmod a+x a b c
+mkdir dir1 dir2 dir2/dir3
+echo : > dir1/foo.test
+echo : > dir2/dir3/foo.test
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure
-$MAKE check
-$MAKE distclean
 mkdir build
 cd build
 ../configure
 $MAKE check
+find . # For debugging.
+test -f test-suite.log
+test -f dir1/foo.log
+test -f dir2/dir3/foo.log
+
+:
diff --git a/tests/python-dist.test b/tests/python-dist.test
new file mode 100755
index 0000000..fbf3ca5
--- /dev/null
+++ b/tests/python-dist.test
@@ -0,0 +1,80 @@
+#! /bin/sh
+# Copyright (C) 2011 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 distribution of *_PYTHON files.
+
+# This test does not require python.
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_PATH_PYTHON([], [:], [:])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+python_PYTHON = python.py
+dist_python_PYTHON = python-dist.py
+nodist_python_PYTHON = python-nodist.py
+
+pkgpython_PYTHON = pkgpython.py
+dist_pkgpython_PYTHON = pkgpython-dist.py
+nodist_pkgpython_PYTHON = pkgpython-nodist.py
+
+mydir = $(prefix)/my
+my_PYTHON = my.py
+dist_my_PYTHON = my-dist.py
+nodist_my_PYTHON = my-nodist.py
+
+my.py my-dist.py my-nodist.py:
+       : > $@
+
+.PHONY: disttest
+disttest: distdir
+       ls -l $(distdir)
+       test -f $(distdir)/python.py
+       test -f $(distdir)/python-dist.py
+       test ! -f $(distdir)/python-nodist.py
+       test -f $(distdir)/pkgpython.py
+       test -f $(distdir)/pkgpython-dist.py
+       test ! -f $(distdir)/pkgpython-nodist.py
+       test -f $(distdir)/my.py
+       test -f $(distdir)/my-dist.py
+       test ! -f $(distdir)/my-nodist.py
+END
+
+: > python.py
+: > python-dist.py
+: > python-nodist.py
+
+: > pkgpython.py
+: > pkgpython-dist.py
+: > pkgpython-nodist.py
+
+: > py-compile
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$MAKE disttest
+# It's not distributed, hence it shouldn't be needlessly generated.
+test ! -f my-nodist.py
+
+:
diff --git a/tests/python-vars.test b/tests/python-vars.test
new file mode 100755
index 0000000..ad263a5
--- /dev/null
+++ b/tests/python-vars.test
@@ -0,0 +1,93 @@
+#! /bin/sh
+# Copyright (C) 2011 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 that AM_PATH_PYTHON correctly sets all the output variables
+# advertised in the manual.
+
+required=python
+. ./defs || Exit 1
+
+set -e
+
+PYTHON=python
+
+# Update these if the documentation changes.
+PYTHON_VERSION=`$PYTHON -c 'import sys; print(sys.version[:3])'` || Exit 1
+PYTHON_PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'` || Exit 1
+PYTHON_EXEC_PREFIX='${exec_prefix}'
+PYTHON_PREFIX='${prefix}'
+pythondir="\${prefix}/lib/python$PYTHON_VERSION/site-packages"
+pyexecdir="\${exec_prefix}/lib/python$PYTHON_VERSION/site-packages"
+pkgpythondir="\${pythondir}/$me"
+pkgpyexecdir="\${pyexecdir}/$me"
+
+pyvars='PYTHON_VERSION PYTHON_PLATFORM PYTHON_PREFIX PYTHON_EXEC_PREFIX
+        pythondir pyexecdir pkgpythondir pkgpyexecdir'
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([vars-got])
+AM_PATH_PYTHON
+AC_OUTPUT
+END
+
+cat > my.py << 'END'
+def my():
+    return 1
+END
+
+cat > Makefile.am << 'END'
+
+python_PYTHON = my.py
+
+EXTRA_DIST = vars-exp
+
+check-local: test-in test-am
+.PHONY: test-in test-am
+
+test-in:
+       cat $(srcdir)/vars-exp
+       cat $(builddir)/vars-got
+       diff $(srcdir)/vars-exp $(builddir)/vars-got
+END
+
+echo > vars-exp
+echo > vars-got.in
+echo test-am: >> Makefile.am
+
+for var in $pyvars; do
+  eval val=\$$var
+  (echo "### $var ###" && echo "$val" && echo) >> vars-exp
+  (echo "### $var ###" && echo "@$var@" && echo) >> vars-got.in
+  echo "${tab}test x'\$($var)' = x'$val'" >> Makefile.am
+done
+
+cat Makefile.am
+cat vars-got.in
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+
+for var in $pyvars; do
+  grep "^$var *=" Makefile.in
+done
+
+$AUTOCONF
+./configure PYTHON="$PYTHON"
+
+$MAKE test-in test-am
+$MAKE distcheck
+
+:
diff --git a/tests/python-virtualenv.test b/tests/python-virtualenv.test
new file mode 100755
index 0000000..478a8dc
--- /dev/null
+++ b/tests/python-virtualenv.test
@@ -0,0 +1,183 @@
+#! /bin/sh
+# Copyright (C) 2011 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 that python support can work well with virtualenvs.
+# This test also works as a mild stress-test on the python support.
+
+required=virtualenv
+. ./defs || Exit 1
+
+set -e
+
+# Skip the test if a proper virtualenv cannot be created.
+virtualenv --verbose virtenv || Exit 77
+test -f virtenv/bin/activate || Exit 77
+
+# Activate the virtualenv.
+. ./virtenv/bin/activate
+# Sanity check.
+test -n "$VIRTUAL_ENV" || Exit 99
+
+cwd=`pwd`
+py_version=`python -c 'import sys; print("%u.%u" % 
tuple(sys.version_info[:2]))'`
+py_site=$VIRTUAL_ENV/lib/python$py_version/site-packages
+
+# We need control over the package name.
+cat > configure.in << END
+AC_INIT([am_virtenv], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_SUBST([MY_VIRTENV], ['$cwd/virtenv'])
+AC_PROG_CC
+AC_PROG_RANLIB
+AM_PATH_PYTHON
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+python_PYTHON = am_foo.py
+pkgpython_PYTHON = __init__.py
+pyexec_LIBRARIES = libquux.a
+libquux_a_SOURCES = foo.c
+pkgpyexec_LIBRARIES = libzardoz.a
+libzardoz_a_SOURCES = foo.c
+
+py_site = $(MY_VIRTENV)/lib/python$(PYTHON_VERSION)/site-packages
+
+.PYTHON: debug test-run test-install test-uninstall
+debug:
+       @echo PYTHON: $(PYTHON)
+       @echo PYTHON_VERSION: $(PYTHON_VERSION)
+       @echo prefix: $(prefix)
+       @echo pythondir: $(pythondir)
+       @echo pkgpythondir: $(pkgpythondir)
+       @echo pyexecdir: $(pyexecdir)
+       @echo pkgpyexecdir: $(pkgpyexecdir)
+test-run:
+       ## In a virtualenv, the default python must be the custom
+       ## virtualenv python.
+       @: \
+         && py1=`python -c 'import sys; print(sys.executable)'` \
+         && py2=`$(PYTHON) -c 'import sys; print(sys.executable)'` \
+         && echo "py1: $$py1" \
+         && echo "py2: $$py2" \
+         && test -n "$$py1" \
+         && test -n "$$py2" \
+         && test x"$$py1" = x"$$py2"
+       ## Check that modules installed in the virtualenv are readily
+       ## available.
+       python -c 'from am_foo import foo_func; assert (foo_func () == 12345)'
+       python -c 'from am_virtenv import old_am; assert (old_am () == 
"AutoMake")'
+test-install:
+       test -f $(py_site)/am_foo.py
+       test -f $(py_site)/am_foo.pyc
+       test -f $(py_site)/am_foo.pyo
+       test -f $(py_site)/am_virtenv/__init__.py
+       test -f $(py_site)/am_virtenv/__init__.pyc
+       test -f $(py_site)/am_virtenv/__init__.pyo
+       test -f $(py_site)/libquux.a
+       test -f $(py_site)/am_virtenv/libzardoz.a
+test-uninstall:
+       test ! -f $(py_site)/am_foo.py
+       test ! -f $(py_site)/am_foo.pyc
+       test ! -f $(py_site)/am_foo.pyo
+       test ! -f $(py_site)/am_virtenv/__init__.py
+       test ! -f $(py_site)/am_virtenv/__init__.pyc
+       test ! -f $(py_site)/am_virtenv/__init__.pyo
+       test ! -f $(py_site)/libquux.a
+       test ! -f $(py_site)/am_virtenv/libzardoz.a
+all-local: debug
+END
+
+cat > am_foo.py << 'END'
+def foo_func ():
+    return 12345
+END
+
+cat > __init__.py << 'END'
+def old_am ():
+    return 'AutoMake'
+END
+
+cat > foo.c << 'END'
+int foo (void)
+{
+  return 0;
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+# Try a VPATH build.
+mkdir build
+cd build
+../configure --prefix="$VIRTUAL_ENV"
+$MAKE install
+$MAKE test-install
+$MAKE test-run
+$MAKE uninstall
+$MAKE test-uninstall
+cd ..
+
+# Try an in-tree build.
+./configure --prefix="$VIRTUAL_ENV"
+$MAKE install
+$MAKE test-install
+$MAKE test-run
+$MAKE uninstall
+$MAKE test-uninstall
+
+$MAKE distclean
+
+# Overriding pythondir and pyexecdir with cache variables should work.
+./configure am_cv_python_pythondir="$py_site" \
+            am_cv_python_pyexecdir="$py_site"
+$MAKE install
+$MAKE test-install
+$MAKE test-run
+$MAKE uninstall
+$MAKE test-uninstall
+
+$MAKE distclean
+
+# Overriding pythondir and pyexecdir at make time should be enough.
+./configure --prefix="$cwd/bad-prefix"
+pythondir=$py_site pyexecdir=$py_site
+export pythondir pyexecdir
+$MAKE -e install
+test ! -d bad-prefix
+$MAKE -e test-install
+$MAKE test-run
+$MAKE -e uninstall
+$MAKE -e test-uninstall
+unset pythondir pyexecdir
+
+# Also check that the distribution is self-contained, for completeness.
+$MAKE distcheck
+
+# Finally, check that if we disable the virtualenv, we shouldn't be
+# able to access to the installed modules anymore.
+cd build
+$MAKE install
+python -c 'import am_foo; print(am_foo.__file__)'
+python -c 'import am_virtenv; print(am_virtenv.__file__)'
+deactivate "nondestructive"
+python -c 'import am_foo' && Exit 1
+python -c 'import am_virtenv' && Exit 1
+
+:
diff --git a/tests/python.test b/tests/python.test
index 11fb0c1..07072da 100755
--- a/tests/python.test
+++ b/tests/python.test
@@ -25,7 +25,12 @@ python_PYTHON = foo.py
 END
 
 $ACLOCAL
-$AUTOMAKE -a
 
-grep '^py_compile =' Makefile.in
+AUTOMAKE_fails
+grep '^Makefile\.am:1:.* required file.*py-compile' stderr
+
+$AUTOMAKE -a
+grep '^py_compile *=' Makefile.in
 test -f py-compile
+
+:
diff --git a/tests/python10.test b/tests/python10.test
index bc291f2..a585cb7 100755
--- a/tests/python10.test
+++ b/tests/python10.test
@@ -39,7 +39,9 @@ one.py:
 two.py:
        echo 'def two(): return 1' >$@
 
+.PHONY: disttest
 disttest: distdir
+       ls -l $(distdir)
        test -f $(distdir)/one.py
        test -f $(distdir)/two.py
 END
@@ -79,3 +81,5 @@ test ! -f "$inst/my/one.pyc"
 test ! -f "$inst/my/one.pyo"
 
 $MAKE disttest
+
+:
diff --git a/tests/python11.test b/tests/python11.test
index cb17f75..2981764 100755
--- a/tests/python11.test
+++ b/tests/python11.test
@@ -45,10 +45,12 @@ sed 's/AM_PATH_PYTHON/AM_PATH_PYTHON(,,:)/' configure.in 
>configure.int
 mv -f configure.int configure.in
 $ACLOCAL --force
 $AUTOCONF --force
-# This one should define PYTHON as : and exit succesfully
+# This one should define PYTHON as : and exit successfully
 ./configure
 
 # Any user setting should be used.
 ./configure PYTHON=foo >stdout && { cat stdout; Exit 1; }
 cat stdout
 grep 'PYTHON = foo' stdout
+
+:
diff --git a/tests/python2.test b/tests/python2.test
index 62c4a69..4403dda 100755
--- a/tests/python2.test
+++ b/tests/python2.test
@@ -18,6 +18,7 @@
 
 . ./defs || Exit 1
 
+$ACLOCAL
 
 echo 1. pythondir not defined
 
@@ -26,8 +27,8 @@ PYTHON = x
 python_PYTHON = foo.py
 END
 
-$ACLOCAL
 AUTOMAKE_fails -a
+grep 'pythondir.*undefined' stderr
 grep AM_PATH_PYTHON stderr
 
 
@@ -38,8 +39,8 @@ PYTHON = x
 pkgpython_PYTHON = foo.py
 END
 
-$ACLOCAL
 AUTOMAKE_fails -a
+grep 'pkgpythondir.*undefined' stderr
 grep AM_PATH_PYTHON stderr
 
 
@@ -50,8 +51,8 @@ PYTHON = x
 pyexec_PYTHON = foo.py
 END
 
-$ACLOCAL
 AUTOMAKE_fails -a
+grep 'pyexecdir.*undefined' stderr
 grep AM_PATH_PYTHON stderr
 
 
@@ -62,8 +63,8 @@ PYTHON = x
 pkgpyexec_PYTHON = foo.py
 END
 
-$ACLOCAL
 AUTOMAKE_fails -a
+grep 'pkgpyexecdir.*undefined' stderr
 grep AM_PATH_PYTHON stderr
 
 
@@ -74,8 +75,8 @@ pkgpyexecdir = /here/we/go
 pkgpyexec_PYTHON = foo.py
 END
 
-$ACLOCAL
 AUTOMAKE_fails -a
+grep 'PYTHON.*undefined' stderr
 grep AM_PATH_PYTHON stderr
 
 
@@ -87,7 +88,7 @@ pkgpyexecdir = /here/we/go
 pkgpyexec_PYTHON = foo.py
 END
 
-$ACLOCAL
+rm -f py-compile
 $AUTOMAKE -a
 test -f py-compile
 
@@ -100,5 +101,6 @@ fubardir = /here/we/go
 fubar_PYTHON = foo.py
 END
 
-$ACLOCAL
 $AUTOMAKE -a
+
+:
diff --git a/tests/python3.test b/tests/python3.test
index e29067b..a5e12bd 100755
--- a/tests/python3.test
+++ b/tests/python3.test
@@ -45,3 +45,5 @@ $MAKE install
 test -f "$inst/my/one.py"
 test -f "$inst/my/one.pyc"
 test -f "$inst/my/one.pyo"
+
+:
diff --git a/tests/python4.test b/tests/python4.test
index 084744b..cd9e4d6 100755
--- a/tests/python4.test
+++ b/tests/python4.test
@@ -30,7 +30,14 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-# Simulate no Python
+# Simulate no Python.
 ./configure PYTHON=: 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep 'no suitable Python interpreter found' stderr
+
+# Again, but from the environment this time.
+env PYTHON=: ./configure 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep 'no suitable Python interpreter found' stderr
+
+:
diff --git a/tests/python5.test b/tests/python5.test
index eabd900..8acbdfe 100755
--- a/tests/python5.test
+++ b/tests/python5.test
@@ -22,7 +22,7 @@
 
 cat >>configure.in <<EOF
 # Hopefully the Python team will never release such a version.
-AM_PATH_PYTHON(9999.9)
+AM_PATH_PYTHON([9999.9])
 AC_OUTPUT
 EOF
 
@@ -32,6 +32,14 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure 2>stderr && { cat stderr >&2; Exit 1; }
+./configure >stdout 2>stderr && { 
+  cat stdout
+  cat stderr >&2
+  Exit 1
+}
+cat stdout
 cat stderr >&2
+$EGREP 'checking for a Python interpreter with version >= 9999\.9\.\.\. 
no(ne)? *$' stdout
 grep 'no suitable Python interpreter found' stderr
+
+:
diff --git a/tests/python5.test b/tests/python5b.test
similarity index 64%
copy from tests/python5.test
copy to tests/python5b.test
index eabd900..7f77cda 100755
--- a/tests/python5.test
+++ b/tests/python5b.test
@@ -15,16 +15,26 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test detection of missing Python.
-# Same as python4.test, but requiring a version.
+# Same as python5.test, but with the user forcing the python to use.
 
-# Python is not required for this test.
+required=python
 . ./defs || Exit 1
 
-cat >>configure.in <<EOF
+set -e
+
+cat >>configure.in << 'END'
 # Hopefully the Python team will never release such a version.
-AM_PATH_PYTHON(9999.9)
+AM_PATH_PYTHON([9999.9])
 AC_OUTPUT
-EOF
+END
+
+mkdir bin
+cat > bin/my-python << 'END'
+#! /bin/sh
+exec python ${1+"$@"}
+END
+chmod a+x bin/my-python
+PATH=`pwd`/bin:$PATH_SEPARATOR$PATH
 
 : > Makefile.am
 
@@ -32,6 +42,14 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure 2>stderr && { cat stderr >&2; Exit 1; }
+./configure PYTHON=my-python >stdout 2>stderr && {
+  cat stdout
+  cat stderr >&2
+  Exit 1
+}
+cat stdout
 cat stderr >&2
-grep 'no suitable Python interpreter found' stderr
+grep 'whether my-python version is >= 9999\.9\.\.\. no *$' stdout
+grep '[Pp]ython interpreter is too old' stderr
+
+:
diff --git a/tests/python6.test b/tests/python6.test
index ac842b3..8b3c6f3 100755
--- a/tests/python6.test
+++ b/tests/python6.test
@@ -21,7 +21,7 @@
 . ./defs || Exit 1
 
 cat >>configure.in <<\EOF
-AM_PATH_PYTHON(,, [echo "GREP ME$PYTHON" >&2])
+AM_PATH_PYTHON(,, [echo "$PYTHON" > py])
 AC_OUTPUT
 EOF
 
@@ -31,9 +31,8 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-# Simulate no Python
-./configure PYTHON=: 2>stderr || { cat stderr >&2; Exit 1; }
-cat stderr >&2
-grep 'GREP ME:' stderr
+# Simulate no Python.
+./configure PYTHON=:
+test x"`cat py`" = x:
 
 :
diff --git a/tests/python7.test b/tests/python7.test
index 1c7d482..1390a4e 100755
--- a/tests/python7.test
+++ b/tests/python7.test
@@ -22,7 +22,7 @@
 
 cat >>configure.in <<\EOF
 # Hopefully the Python team will never release such a version.
-AM_PATH_PYTHON(9999.9,, [echo "GREP ME$PYTHON" >&2])
+AM_PATH_PYTHON([9999.9], [], [echo "$PYTHON" > py])
 AC_OUTPUT
 EOF
 
@@ -32,8 +32,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure 2>stderr || { cat stderr >&2; Exit 1; }
-cat stderr >&2
-grep 'GREP ME:' stderr
+./configure
+test x"`cat py`" = x:
 
 :
diff --git a/tests/python8.test b/tests/python8.test
index 8ed3c3d..981e64d 100755
--- a/tests/python8.test
+++ b/tests/python8.test
@@ -19,8 +19,9 @@
 required=python
 . ./defs || Exit 1
 
-cat >>configure.in <<EOF
-AM_PATH_PYTHON(, [echo 'GREP ME' >&2])
+cat >>configure.in <<'EOF'
+# $PYTHON is supposed to be properly set in ACTION-IF-TRUE.
+AM_PATH_PYTHON(, [$PYTHON -V >py-version 2>&1])
 AC_OUTPUT
 EOF
 
@@ -30,8 +31,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure 2>stderr || { cat stderr >&2; Exit 1; }
-cat stderr >&2
-grep 'GREP ME' stderr
+./configure
+grep '^Python [0-9]\.[0-9][0-9]*\.[0-9]' py-version
 
 :
diff --git a/tests/python9.test b/tests/python9.test
index e58058c..da95884 100755
--- a/tests/python9.test
+++ b/tests/python9.test
@@ -15,13 +15,14 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test ACTION-IF-TRUE in AM_PATH_PYTHON.
-# Same as python8.test, but requiring a version.
+# Similar to python8.test, but requiring a version.
 
 required=python
 . ./defs || Exit 1
 
-cat >>configure.in <<EOF
-AM_PATH_PYTHON(0.0, [echo 'GREP ME' >&2])
+cat >>configure.in <<'EOF'
+# $PYTHON is supposed to be properly set in ACTION-IF-TRUE.
+AM_PATH_PYTHON([0.0], [$PYTHON -c 'print("%u:%u" % (1-1, 2**0))' > py.out])
 AC_OUTPUT
 EOF
 
@@ -31,8 +32,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure 2>stderr || { cat stderr >&2; Exit 1; }
-cat stderr >&2
-grep 'GREP ME' stderr
+./configure
+test x"`cat py.out`" = x0:1
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]