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/python12.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 't/python12.sh') diff --git a/t/python12.sh b/t/python12.sh index 898c673dc..12dca5d18 100755 --- a/t/python12.sh +++ b/t/python12.sh @@ -36,19 +36,19 @@ $ACLOCAL $AUTOCONF $AUTOMAKE --add-missing -instdir=$(pwd)/inst +destdir=$(pwd)/inst mkdir inst build cd build ../configure --prefix="/usr" -$MAKE install DESTDIR=$instdir +$MAKE install DESTDIR=$destdir # Perfunctory test that the files were created. -test -f "$instdir/usr/share/my/my.py" -test -f "$instdir/usr/share/my/my.pyc" -test -f "$instdir/usr/share/my/my.pyo" +test -f "$destdir/usr/share/my/my.py" +pyo=$(pyc_location -p "$destdir/usr/share/my/my.pyo") +pyc=$(pyc_location -p "$destdir/usr/share/my/my.pyc") # If DESTDIR has made it into the byte compiled files, fail the test. -$FGREP "$instdir" "$instdir/usr/share/my/my.pyo" \ - "$instdir/usr/share/my/my.pyc" && exit 1 +st=0; $FGREP "$destdir" "$pyc" "$pyo" || st=$? +test $st -eq 1 : -- cgit v1.2.1