Hash :
6366a170
Author :
Date :
2011-02-01T23:22:08
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 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
: