From 1bf8e0847f33bfc29060da9f1512db37f37bc992 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 10 May 2016 14:48:03 +0100 Subject: [PATCH] run py tests from "make check" though they fail on ubuntu 16.04 due to giflib dumbness magickload is also failing, investigate --- test/Makefile.am | 21 +++++++++++++-------- test/test_python.sh | 26 ++++++++++++++++++-------- test/variables.sh.in | 1 + 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index bd82e2ca..56dc0f2d 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,3 +1,16 @@ +TESTS = + +if ENABLE_PYVIPS8 +TESTS += \ + test_python.sh +endif + +# don't run test_thumbnail.sh by default, it takes ages +TESTS += \ + test_cli.sh \ + test_formats.sh \ + test_seq.sh \ + test_threading.sh EXTRA_DIST = \ images \ @@ -21,14 +34,6 @@ EXTRA_DIST = \ test_morphology.py \ test_resample.py -# don't run test_thumbnail.sh by default, it takes ages - -TESTS = \ - test_cli.sh \ - test_formats.sh \ - test_seq.sh \ - test_threading.sh - clean-local: -rm -rf tmp-* -rm -f *.pyc diff --git a/test/test_python.sh b/test/test_python.sh index ec464471..e361d4f2 100755 --- a/test/test_python.sh +++ b/test/test_python.sh @@ -2,16 +2,26 @@ # set -x -# don't run this set of tests as part of make check -- some platforms do make -# check before install and it's too hard to make pyvips8 work without -# installation - . ./variables.sh -echo "testing with python2 ..." +export GI_TYPELIB_PATH=../libvips -python2 test_all.py +vipslibs=../libvips/.libs -echo "testing with python3 ..." +# we want to test against the built but uninstalled libraries, so we must set +# LD_LIBRARY_PATH or equivalent +case `uname` in +HPUX) + export SHLIB_PATH=$vipslibs + ;; -python3 test_all.py +Darwin) + export DYLD_LIBRARY_PATH=$vipslibs + ;; + +*) + export LD_LIBRARY_PATH=$vipslibs + ;; +esac + +$PYTHON -m unittest -v test_all diff --git a/test/variables.sh.in b/test/variables.sh.in index f2751c31..efb90aab 100644 --- a/test/variables.sh.in +++ b/test/variables.sh.in @@ -1,4 +1,5 @@ top_srcdir=@TOP_SRCDIR@ +PYTHON=@PYTHON@ # we need a different tmp for each script since make can run tests in parallel tmp=$top_srcdir/test/tmp-$$ test_images=$top_srcdir/test/images