-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
45 lines (40 loc) · 1.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
language: cpp
compiler: gcc
branches:
only:
- master
addons:
# Install lcov for codecoverage
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- lcov
- g++-7
before_install:
# Force compilers
- eval "CC=gcc-7 && CXX=g++-7"
- echo "CC = $CC"
- echo "CXX = $CXX"
# Install CMake 3.12 and hack $PATH to use it
- mkdir $HOME/usr
- export PATH="$HOME/usr/bin:$PATH"
- wget https://cmake.org/files/v3.12/cmake-3.12.4-Linux-x86_64.sh
- chmod +x cmake-3.12.4-Linux-x86_64.sh
- ./cmake-3.12.4-Linux-x86_64.sh --prefix=$HOME/usr --exclude-subdir --skip-license
script:
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Coverage
- make
- ctest -V
after_success:
# Creating report
- cd ${TRAVIS_BUILD_DIR}
- lcov --directory . --capture --output-file coverage.info # capture coverage info
- lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
- lcov --remove coverage.info '/opt/*' --output-file coverage.info # filter out Qt
- lcov --remove coverage.info 'test_*' --output-file coverage.info # filter out test implementations
- lcov --list coverage.info #debug info
# Uploading report to CodeCov
- bash <(curl -s https://codecov.io/bash) -a "-g test_" || echo "Codecov did not collect coverage reports"