-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
53 lines (45 loc) · 1.52 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
language: c
dist: xenial
sudo: false
compiler: gcc
os: linux
env: COMPILER=gcc-7 CODE_COVERAGE=true CMAKE_BUILD_TYPE=Debug BUILD_DIRECTORY=cmake-build-debug
cache: # see https://docs.travis-ci.com/user/caching/
- directories:
- $HOME/.cache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq gcc-7
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
- sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-7 90
- sudo apt-get install -qq -y lcov
- sudo apt-get install -qq -y valgrind
- sudo apt-get install -qq -y ruby
- sudo gem install coveralls-lcov
- export CC="${COMPILER}"
install:
- chmod +x ./pre-install.sh
- ./pre-install.sh
before_script:
- ${CC} --version
- cmake --version
- lcov --version
- gcov --version
- valgrind --version
script:
- mkdir -p ${BUILD_DIRECTORY} && cd ${BUILD_DIRECTORY} || exit 1
- cmake -D ENABLE_COVERAGE:BOOL=TRUE .. || exit 1
- make || exit 1
- ctest -V || exit 1
- ctest -T memcheck || exit 1
after_success:
# Create lcov report (assumes are we still in the build directory) ${TRAVIS_BUILD_DIR}/${BUILD_DIRECTORY}
- lcov --capture --directory . --output-file coverage.info --gcov-tool gcov-7
- lcov --remove coverage.info '/usr/*' 'test/*' --output-file coverage.info
- lcov --list coverage.info
# Uploading report to CodeCov
- bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"