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:
commit
05ef6a5af8
95
.travis.yml
95
.travis.yml
|
@ -1,19 +1,86 @@
|
||||||
language: cpp
|
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:
|
before_script:
|
||||||
- ./bootstrap.sh
|
- ./bootstrap.sh
|
||||||
- ./configure
|
- ./configure
|
||||||
- make
|
--disable-dependency-tracking
|
||||||
- sudo make install
|
--with-jpeg-includes=$JPEG/include
|
||||||
- sudo ldconfig
|
--with-jpeg-libraries=$JPEG/lib
|
||||||
|
- make -j$JOBS -s V=0
|
||||||
script:
|
script:
|
||||||
- make check
|
- 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
|
||||||
|
|
|
@ -772,8 +772,6 @@ fi
|
||||||
|
|
||||||
if test x"$enable_pyvips8" = x"yes"; then
|
if test x"$enable_pyvips8" = x"yes"; then
|
||||||
PKG_CHECK_MODULES(PYGOBJECT, [pygobject-3.0 >= 3.12.0])
|
PKG_CHECK_MODULES(PYGOBJECT, [pygobject-3.0 >= 3.12.0])
|
||||||
pyoverridesdir="\$(pyexecdir)/gi/overrides"
|
|
||||||
AC_SUBST(pyoverridesdir)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AM_CONDITIONAL(ENABLE_PYVIPS8, test x"$enable_pyvips8" = x"yes")
|
AM_CONDITIONAL(ENABLE_PYVIPS8, test x"$enable_pyvips8" = x"yes")
|
||||||
|
@ -994,6 +992,9 @@ AC_OUTPUT([
|
||||||
tools/light_correct
|
tools/light_correct
|
||||||
tools/shrink_width
|
tools/shrink_width
|
||||||
python/Makefile
|
python/Makefile
|
||||||
|
python/packages/Makefile
|
||||||
|
python/packages/gi/Makefile
|
||||||
|
python/packages/gi/overrides/Makefile
|
||||||
test/Makefile
|
test/Makefile
|
||||||
test/variables.sh
|
test/variables.sh
|
||||||
swig/Makefile
|
swig/Makefile
|
||||||
|
|
|
@ -1,17 +1,5 @@
|
||||||
vips_overridesdir = $(pyoverridesdir)
|
SUBDIRS = packages
|
||||||
vips_overrides_PYTHON = Vips.py
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
README.md
|
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
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
SUBDIRS = gi
|
|
@ -0,0 +1,5 @@
|
||||||
|
SUBDIRS = overrides
|
||||||
|
|
||||||
|
EXTRA_DIST = \
|
||||||
|
__init__.py
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
# support overrides in different directories than our gi module
|
||||||
|
from pkgutil import extend_path
|
||||||
|
__path__ = extend_path(__path__, __name__)
|
|
@ -0,0 +1,5 @@
|
||||||
|
vips_overridesdir = $(pyexecdir)/gi/overrides
|
||||||
|
vips_overrides_PYTHON = Vips.py
|
||||||
|
|
||||||
|
EXTRA_DIST = \
|
||||||
|
__init__.py
|
|
@ -0,0 +1,3 @@
|
||||||
|
# support overrides in different directories than our gi module
|
||||||
|
from pkgutil import extend_path
|
||||||
|
__path__ = extend_path(__path__, __name__)
|
|
@ -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 = \
|
EXTRA_DIST = \
|
||||||
images \
|
images \
|
||||||
|
@ -21,14 +34,6 @@ EXTRA_DIST = \
|
||||||
test_morphology.py \
|
test_morphology.py \
|
||||||
test_resample.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:
|
clean-local:
|
||||||
-rm -rf tmp-*
|
-rm -rf tmp-*
|
||||||
-rm -f *.pyc
|
-rm -f *.pyc
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import sys
|
||||||
|
sys.path.append('../python/packages')
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
# as a test of the command-line interface
|
# as a test of the command-line interface
|
||||||
|
|
||||||
# set -x
|
# set -x
|
||||||
|
set -e
|
||||||
|
|
||||||
. ./variables.sh
|
. ./variables.sh
|
||||||
|
|
||||||
|
|
|
@ -2,16 +2,26 @@
|
||||||
|
|
||||||
# set -x
|
# 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
|
. ./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
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
top_srcdir=@TOP_SRCDIR@
|
top_srcdir=@TOP_SRCDIR@
|
||||||
|
PYTHON=@PYTHON@
|
||||||
# we need a different tmp for each script since make can run tests in parallel
|
# we need a different tmp for each script since make can run tests in parallel
|
||||||
tmp=$top_srcdir/test/tmp-$$
|
tmp=$top_srcdir/test/tmp-$$
|
||||||
test_images=$top_srcdir/test/images
|
test_images=$top_srcdir/test/images
|
||||||
|
|
Loading…
Reference in New Issue