summaryrefslogtreecommitdiff
path: root/t/py-compile-basedir.sh
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-11-19 22:19:21 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-11-19 22:58:38 +0100
commite1acf4a06f5a8d9e861455ac29abb4944a446494 (patch)
tree4396eedc2e2ee75d09444338c60cfc84624a8086 /t/py-compile-basedir.sh
parent3fea76478eb1364093804365904fdb3c1e5c93d2 (diff)
downloadautomake-e1acf4a06f5a8d9e861455ac29abb4944a446494.tar.gz
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 <stefano.lattarini@gmail.com>
Diffstat (limited to 't/py-compile-basedir.sh')
-rwxr-xr-xt/py-compile-basedir.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/t/py-compile-basedir.sh b/t/py-compile-basedir.sh
index f2cef307a..75b45f78e 100755
--- a/t/py-compile-basedir.sh
+++ b/t/py-compile-basedir.sh
@@ -38,13 +38,17 @@ for d in foo foo/bar "$(pwd)/foo" . .. ../foo ''; do
: > "$d2/$f.py"
: > "$d2/sub/$f.py"
./py-compile --basedir "$d" "$f.py" "sub/$f.py"
- ls -l "$d2" "$d2/sub" # For debugging.
- test -f "$d2/$f.pyc"
- test -f "$d2/$f.pyo"
- test -f "$d2/sub/$f.pyc"
- test -f "$d2/sub/$f.pyo"
- rm -f "$d2/$f.pyc" "$d2/$f.pyo" "$d2/sub/$f.pyc" "$d2/sub/$f.pyo"
- find . | grep '\.py[co]$' && exit 1
+ find "$d2" # For debugging.
+ py_installed "$d2/$f.pyc"
+ py_installed "$d2/$f.pyo"
+ py_installed "$d2/sub/$f.pyc"
+ py_installed "$d2/sub/$f.pyo"
+ files=$(find "$d2" | grep '\.py[co]$')
+ test $(echo "$files" | wc -l) -eq 4
+ case $d2 in
+ .|..) rm -f $files;;
+ *) rm -rf "$d2";;
+ esac
done
: