sudo: false
virtualenv:
  system_site_packages: true

matrix:
  include:
    - os: osx
      language: generic
      env: VTK_VERSION=5.8 ETS_TOOLKIT=qt4
    - os: osx
      language: generic
      env: VTK_VERSION=5.8 ETS_TOOLKIT=wx
    - os: osx
      language: generic
      env: VTK_VERSION=7.0 ETS_TOOLKIT=wx
    - os: linux
      language: python
      python: 2.7
      env: VTK_VERSION=5.8 ETS_TOOLKIT=qt4
    - os: linux
      language: python
      python: 2.7
      env: VTK_VERSION=5.8 ETS_TOOLKIT=wx
    - os: linux
      language: python
      python: 2.7
      env: VTK_VERSION=6.3 ETS_TOOLKIT=wx
    - os: linux
      language: python
      python: 2.7
      env: VTK_VERSION=7.0 ETS_TOOLKIT=wx
  allow_failures:      
    - os: osx
      language: generic
      env: VTK_VERSION=5.8 ETS_TOOLKIT=qt4
    - os: osx
      language: generic
      env: VTK_VERSION=5.8 ETS_TOOLKIT=wx
    - os: osx
      language: generic
      env: VTK_VERSION=7.0 ETS_TOOLKIT=wx
    - os: linux
      language: python
      python: 2.7
      env: VTK_VERSION=6.3 ETS_TOOLKIT=wx
    - os: linux
      language: python
      python: 2.7
      env: VTK_VERSION=7.0 ETS_TOOLKIT=wx
    
# Travis Ubuntu 12 does not allow python-pyside
addons:
  apt:
    packages:
    - python-vtk
    - python-qt4
    - python-qt4-gl
    - python-imaging
    - python-pip
    - python-wxtools
    - ccache
cache:
  directories:
    - $HOME/.cache
    - $HOME/.ccache
before_install:
  - source travis/before_install.sh
install:
  - source travis/setup_vtk_env.sh
  # Print the VTK version
  - python -c "from __future__ import print_function; import vtk; print('VTK Version:', vtk.vtkVersion.GetVTKVersion())"
  - pip install -r travis/travis-requirements.txt
  - python setup.py develop
script:
  - coverage erase
  - coverage run -p -m nose.core -v tvtk/tests
  - coverage run -p -m nose.core -v mayavi
  # We can't run the integrationtests on travis with qt because python-pyside is forbidden
  # And PyQt hangs during event loop
  - if [[ ${ETS_TOOLKIT} == "wx" ]]; then sh travis/travis-run-integration-tests.sh; fi
  - coverage combine
after_success:
  - pip install codecov
  - codecov
