Merge pull request #438 from felixbuenemann/run-python-tests-on-travis

Run python tests on travis and setup build matrix
This commit is contained in:
John Cupitt 2016-06-04 11:42:39 +01:00
commit 05ef6a5af8
14 changed files with 141 additions and 48 deletions

View File

@ -1,19 +1,86 @@
language: cpp
before_install:
- sudo apt-get update -qq
- sudo apt-get install automake gtk-doc-tools
- sudo apt-get install gobject-introspection
- sudo apt-get install libfftw3-dev libjpeg-turbo8-dev
- sudo apt-get install libpng12-dev libwebp-dev libtiff4-dev libxml2-dev
- sudo apt-get install swig libmagick++-dev bc
- sudo apt-get install libcfitsio3-dev libgsl0-dev libmatio-dev
- sudo apt-get install liborc-0.4-dev liblcms2-dev libpoppler-glib-dev
- sudo apt-get install librsvg2-dev libgif-dev
before_script:
- ./bootstrap.sh
- ./configure
- make
- sudo make install
- sudo ldconfig
script:
- make check
- ./configure
--disable-dependency-tracking
--with-jpeg-includes=$JPEG/include
--with-jpeg-libraries=$JPEG/lib
- make -j$JOBS -s V=0
script:
- make -Ctest -j$JOBS -s V=0 VERBOSE=1 check
matrix:
fast_finish: true
allow_failures:
- os: osx
include:
- os: linux
sudo: required
dist: precise
env:
- PYTHON=/usr/bin/python
- JPEG=/usr
- JOBS=`nproc`
- LIBTOOLFLAGS=--quiet
cache: ccache
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y
automake gtk-doc-tools
gobject-introspection
libfftw3-dev libjpeg-turbo8-dev
libpng12-dev libwebp-dev libtiff4-dev libxml2-dev
swig libmagick++-dev bc
libcfitsio3-dev libgsl0-dev libmatio-dev
liborc-0.4-dev liblcms2-dev libpoppler-glib-dev
librsvg2-dev libgif-dev
libpango1.0-dev
python-dev
- os: linux
sudo: required
dist: trusty
env:
- PYTHON=/usr/bin/python
- JPEG=/usr
- JOBS=`nproc`
cache: ccache
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y
automake gtk-doc-tools
gobject-introspection
libfftw3-dev libjpeg-turbo8-dev
libpng12-dev libwebp-dev libtiff4-dev libxml2-dev
swig libmagick++-dev bc
libcfitsio3-dev libgsl0-dev libmatio-dev
liborc-0.4-dev liblcms2-dev libpoppler-glib-dev
librsvg2-dev libgif-dev
libpango1.0-dev libgsf-1-dev libopenslide-dev
python-dev python-gi-dev libgirepository1.0-dev
- os: osx
osx_image: xcode7.3
env:
- PYTHON=/usr/local/bin/python
- JPEG=/usr/local/opt/mozjpeg
- PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig
- JOBS="`sysctl -n hw.ncpu`"
- PATH="/usr/local/opt/ccache/libexec:$PATH"
cache: ccache
before_install:
- brew tap homebrew/science
- brew update
- brew install ccache pkg-config automake
- brew install --ignore-dependencies gtk-doc
- brew reinstall
gobject-introspection
fftw mozjpeg libexif
libpng webp libtiff
swig imagemagick
cfitsio libmatio
orc little-cms2 poppler
pango libgsf openslide
librsvg giflib openexr
python pygobject3

View File

@ -772,8 +772,6 @@ fi
if test x"$enable_pyvips8" = x"yes"; then
PKG_CHECK_MODULES(PYGOBJECT, [pygobject-3.0 >= 3.12.0])
pyoverridesdir="\$(pyexecdir)/gi/overrides"
AC_SUBST(pyoverridesdir)
fi
AM_CONDITIONAL(ENABLE_PYVIPS8, test x"$enable_pyvips8" = x"yes")
@ -994,6 +992,9 @@ AC_OUTPUT([
tools/light_correct
tools/shrink_width
python/Makefile
python/packages/Makefile
python/packages/gi/Makefile
python/packages/gi/overrides/Makefile
test/Makefile
test/variables.sh
swig/Makefile

View File

@ -1,17 +1,5 @@
vips_overridesdir = $(pyoverridesdir)
vips_overrides_PYTHON = Vips.py
SUBDIRS = packages
EXTRA_DIST = \
README.md
# if we build in a separate tree, we need to symlink the *.py files from the
# source tree; Python does not accept the extensions and modules in different
# paths
build_pylinks:
for f in $(vips_overrides_PYTHON); do \
[ -e $(builddir)/$$f ] || $(LN_S) $(srcdir)/$$f $(builddir)/$$f; \
done
all-local: build_pylinks
check-local: build_pylinks

View File

@ -0,0 +1 @@
SUBDIRS = gi

View File

@ -0,0 +1,5 @@
SUBDIRS = overrides
EXTRA_DIST = \
__init__.py

View File

@ -0,0 +1,3 @@
# support overrides in different directories than our gi module
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)

View File

@ -0,0 +1,5 @@
vips_overridesdir = $(pyexecdir)/gi/overrides
vips_overrides_PYTHON = Vips.py
EXTRA_DIST = \
__init__.py

View File

@ -0,0 +1,3 @@
# support overrides in different directories than our gi module
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)

View File

@ -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

View File

@ -1,4 +1,7 @@
#!/usr/bin/python3
#!/usr/bin/env python
import sys
sys.path.append('../python/packages')
import unittest

View File

@ -4,6 +4,7 @@
# as a test of the command-line interface
# set -x
set -e
. ./variables.sh

View File

@ -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

View File

@ -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