-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy path.travis.yml
84 lines (75 loc) · 2.41 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
sudo: false
dist: trusty
language: cpp
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-7','g++-7','libpcap-dev','libjson-c-dev','valgrind','gcovr','ccache','texlive-latex-base']
cache:
apt: true
directories:
- ccache
- $HOME/.ccache
- $DEPS_DIR
env:
global:
- DEPS_DIR="$HOME/install"
- LCOV_DIR="$DEPS_DIR/lcov-1.11"
- LCOV="$LCOV_DIR/bin/lcov"
matrix:
include:
- os: linux
compiler: gcc
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- CXXFLAGS="-g -O0 -fprofile-arcs -ftest-coverage -fPIC" CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage" gcov="/usr/bin/gcov-7"
fast_finish: true
- os: linux
compiler: clang
env:
- MATRIX_EVAL="CC=clang && CXX=clang++"
fast_finish: true
- os: linux
compiler: clang
env:
- MATRIX_EVAL="CC=clang && CXX=clang++"
- CXXFLAGS="-fsanitize=address"
fast_finish: true
- os: linux
compiler: clang
env:
- MATRIX_EVAL="CC=clang && CXX=clang++"
- CXXFLAGS="-fsanitize=thread"
fast_finish: true
before_install:
- eval "${MATRIX_EVAL}"
- export
install:
- pip install --user --upgrade cpp-coveralls
- gem install coveralls-lcov
- |
if [ ! -f "$LCOV" ]; then
wget -O - --no-check-certificate http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz && cp -r lcov-1.11 $DEPS_DIR
make -C $LCOV_DIR
else
echo "Using cached lcov"
fi
before_script:
- gcov --version
- $LCOV --gcov-tool "/usr/bin/gcov-7" --directory . --zerocounters
script:
- |
ctest --build-and-test . ./build --build-config debug --build-generator 'Unix Makefiles' --parallel 4 --build-target all \
--build-options -DGTEST_SOURCE_DIR=$TRAVIS_BUILD_DIR/third_party/googletest -DINCLUDE_COVERAGE_INFO="true" \
--test-command ctest
- cmake --build ./build --target documentation-pdflatex
- ccache -s
after_success:
- |
if [[ "$CXX" == "g++"* ]]; then
$LCOV --gcov-tool "/usr/bin/gcov-7" --compat-libtool --directory . --capture --output-file coverage.info # capture coverage info
$LCOV --gcov-tool "/usr/bin/gcov-7" --remove coverage.info 'tests/*' '/usr/*' '*gmock*' --output-file coverage.info # filter out system and test code
coveralls-lcov coverage.info
fi
after_failure:
- cat $TRAVIS_BUILD_DIR/build/Testing/Temporary/LastTest.log