-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
46 lines (40 loc) · 1.39 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
language: cpp
compiler:
- gcc
before_install:
# for gcc with C++11 support
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get -qq update
install:
# install GTest and GMock
- sudo apt-get -qq install libgtest-dev
- "cd /usr/src/gtest && sudo cmake . && sudo cmake --build . && sudo mv libg* /usr/local/lib/ ; cd -"
- sudo apt-get -qq install google-mock
- "cd /usr/src/gmock && sudo cmake . && sudo cmake --build . && sudo mv libg* /usr/local/lib/ ; cd -"
# update to gcc with C++11 support
- sudo apt-get -qq install gcc-4.9 g++-4.9
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 90
- sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.9 90
# install latest LCOV (1.9 was failing)
- cd ${TRAVIS_BUILD_DIR}
- wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz
- tar xf lcov_1.11.orig.tar.gz
- sudo make -C lcov-1.11/ install
- gem install coveralls-lcov
- lcov --version
- g++ --version
before_script:
- cd ${TRAVIS_BUILD_DIR}
# init coverage to 0 (optional)
- lcov --directory . --zerocounters
script:
- cd ${TRAVIS_BUILD_DIR}
- cmake .
- make
- ctest --verbose
after_success:
- cd ${TRAVIS_BUILD_DIR}
- lcov --directory . --capture --output-file coverage.info
- lcov --remove coverage.info 'tests/*' '/usr/*' --output-file coverage.info
- lcov --list coverage.info
- coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info