From e1acf4a06f5a8d9e861455ac29abb4944a446494 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Mon, 19 Nov 2012 22:19:21 +0100 Subject: python tests: support PEP-3147 installation layout This fixes several spurious testsuite failures with python >= 3.2, introduced by recent commit v1.12.4-43-ge0e99ed, "python: improve support for modern python (CPython 3.2 and PyPy)". * t/ax/am-test-lib.sh (python_has_pep3147, pyc_location, py_installed): New functions. ($am_pep3147_tag): New variable. * t/py-compile-basic2.sh: Deleted, too difficult to adapt for the gain it would offer; move the still relevant parts ... * t/py-compile-basic.sh: ... here. Adapt and adjust the rest of the test as well. * t/nobase-python.sh: Adapt and adjust. * t/py-compile-basedir.sh: Likewise. * t/py-compile-destdir.sh: Likewise. * t/py-compile-option-terminate.sh: Likewise. * t/python-pr10995.sh: Likewise. * t/python-virtualenv.sh: Likewise. * t/python10.sh: Likewise. * t/python12.sh: Likewise. * t/python3.sh: Likewise. * t/list-of-tests.mk: Adjust list of tests. Signed-off-by: Stefano Lattarini --- t/py-compile-basic.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 't/py-compile-basic.sh') diff --git a/t/py-compile-basic.sh b/t/py-compile-basic.sh index 73597c35c..cc5fec3d5 100755 --- a/t/py-compile-basic.sh +++ b/t/py-compile-basic.sh @@ -46,7 +46,8 @@ class Foo: bar = baz = (1, (2,), [3, 4]); zardoz = 0; END -cat > bar.py <<'END' +mkdir sub +cat > sub/bar.py <<'END' # Import of non-existent modules, or assertion of false conditions, # shouldn't cause problems, as it should be enough for the code to # be syntactically correct. @@ -54,10 +55,16 @@ import Automake.No.Such.Module assert False END -./py-compile foo.py bar.py -test -f foo.pyc -test -f foo.pyo -test -f bar.pyc -test -f bar.pyo +# An empty file in a more deeply-nested directory should be ok as well. +mkdir -p 1/_/2/_/3/_ +: > 1/_/2/_/3/_/0.py + +./py-compile foo.py sub/bar.py 1/_/2/_/3/_/0.py +py_installed foo.pyc +py_installed foo.pyo +py_installed sub/bar.pyc +py_installed sub/bar.pyo +py_installed 1/_/2/_/3/_/0.pyc +py_installed 1/_/2/_/3/_/0.pyo : -- cgit v1.2.1