forked from Martinsos/edlib
/
.travis.yml
44 lines (34 loc) · 1.62 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
language: cpp
compiler:
- gcc
- clang
os:
- linux
- osx
dist: trusty
addons:
apt:
packages:
clang
# NOTE: Currently I commented out testing of python binding on OSX because they do not support
# Python building and I have to provide the tools myself. I could probably install correct pip
# (and maybe python) version myself (homebrew?), however I haven't gotten to that yet.
install:
- if [ $TRAVIS_OS_NAME == "linux" ]; then sudo apt-get install valgrind; fi
- if [ $TRAVIS_OS_NAME == "linux" ]; then sudo -H pip install cython; fi # Needed to build Python module.
before_script:
# Build C/C++ library and apps.
- mkdir -p build && cd build && cmake .. && make && cd ..
# Build Python source distribution and install Edlib from it.
- if [ $TRAVIS_OS_NAME == "linux" ]; then cd bindings/python && make sdist && cd ../..; fi
- if [ $TRAVIS_OS_NAME == "linux" ]; then sudo -H pip install bindings/python/dist/edlib*.tar.gz; fi
script:
# Test C/C++ library.
- build/bin/runTests
# Check for memory leaks. Returns 2 if there was a memory leak/error, otherwise returns runTests exit code,
# which is 0 if all went fine or 1 if some of the tests failed. I test for memory leaks only on linux because
# osx returns errors from system libraries, which I would have to supress.
# This is run only on smaller number of tests, since executing on valgrind is slow.
- if [ $TRAVIS_OS_NAME == "linux" ]; then valgrind --quiet --error-exitcode=2 --tool=memcheck --leak-check=full build/bin/runTests 2; fi
# Test Python module.
- if [ $TRAVIS_OS_NAME == "linux" ]; then sudo -H python bindings/python/test.py; fi