forked from apolukhin/Boost-Cookbook
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
115 lines (97 loc) · 4.57 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Copyright Antony Polukhin 2014-2017.
#
# See https://svn.boost.org/trac/boost/wiki/TravisCoverals for description of this file
# and how it can be used with Boost libraries.
sudo: false
language: cpp
compiler:
- gcc
os:
- linux
env:
global:
- BRANCH_TO_TEST=master
- IGNORE_COVERAGE='*/boost-local/*'
matrix:
- CXX_FLAGS="--coverage -fsanitize=address,leak,undefined" LINK_FLAGS="--coverage" QLIBS="-lasan -lubsan" TOOLSET=gcc-6 CXXTOOLSET=g++-6 GCOV="--gcov-tool gcov-6"
- CXX_FLAGS="--coverage -fsanitize=leak" LINK_FLAGS="--coverage" TOOLSET=gcc-5 CXXTOOLSET=g++-5 GCOV="--gcov-tool gcov-5"
- CXX_FLAGS="-Wno-c++11-narrowing" TOOLSET=clang-3.9 CXXTOOLSET=clang++-3.9
- CXX_FLAGS="-Wno-c++11-narrowing" TOOLSET=clang-3.6 CXXTOOLSET=clang++-3.6
# Hits linker issue
#- CXX_FLAGS="-std=c++14 -Wno-c++11-narrowing -fsanitize=address,leak -stdlib=libc++" LINK_FLAGS="-stdlib=libc++ -fsanitize=address,leak" TOOLSET=clang-3.9 CXXTOOLSET=clang++-3.9
# Hits linker issue
#- CXX_FLAGS="-std=c++14 -Wno-c++11-narrowing -stdlib=libc++" LINK_FLAGS="-stdlib=libc++" TOOLSET=clang-3.9 CXXTOOLSET=clang++-3.9
# Coroutine2 has issue with this compiler
#- CXX_FLAGS="--coverage -O0" LINK_FLAGS="--coverage" TOOLSET=gcc CXXTOOLSET=g++
###############################################################################################################
# From this point and below code is same for all the Boost libs
###############################################################################################################
# Installing additional tools
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
- llvm-toolchain-precise-3.9
- git-core
packages:
- git
- python-yaml
- gcc-6
- g++-6
- gcc-5
- g++-5
- clang-3.6
- clang-3.9
- qt4-qmake
- language-pack-ru
- gdb
- libc++-dev
before_install:
# Set this to the name of the library
- PROJECT_TO_TEST=`basename $TRAVIS_BUILD_DIR`
- echo "Testing $PROJECT_TO_TEST"
# Cloning Boost libraries (fast nondeep cloning)
- PROJECT_DIR=`pwd`
- BOOST=$HOME/boost-local
- git init $BOOST
- cd $BOOST
- git remote add --no-tags -t $BRANCH_TO_TEST origin https://github.com/boostorg/boost.git
- git fetch --depth=1
- git checkout $BRANCH_TO_TEST
- git submodule update --init --merge >/dev/null
- git remote set-branches --add origin $BRANCH_TO_TEST
- git pull --recurse-submodules
- git submodule update --init >/dev/null
- git checkout $BRANCH_TO_TEST
- git submodule foreach "git reset --quiet --hard; git clean -fxd"
- git reset --hard; git clean -fxd
- git status
- ./bootstrap.sh
- ./b2 headers
- ./b2 -j4 toolset=$TOOLSET address-model=64 architecture=x86 link=shared --with-program_options --with-filesystem --with-system --with-test --with-atomic --with-thread --with-timer --with-chrono --with-regex --with-random --with-context stage
- cd $PROJECT_DIR
script:
- qmake "QMAKE_CXX=$CXXTOOLSET" "QMAKE_LINK=$CXXTOOLSET" "QMAKE_CXXFLAGS+=$CXX_FLAGS" "QMAKE_LFLAGS+=$LINK_FLAGS" "LIBS+=$QLIBS" "BOOST_PATH=$BOOST" "CONFIG+=debug" BoostBook.pro
- make -j4
# Executing examples
- python ./test.py -v
after_success:
- mkdir -p $TRAVIS_BUILD_DIR/coverals
- wget https://github.com/linux-test-project/lcov/archive/v1.12.zip
- unzip v1.12.zip
- LCOV="`pwd`/lcov-1.12/bin/lcov $GCOV"
- find Chapter*/* -type d -exec $LCOV --directory "{}" --base-directory ./"{}" --capture --output-file "{}"/tmp_coverage.info \;
- find Chapter*/ -name tmp_coverage.info -print0 | xargs -0 -I {} $LCOV --remove "{}" "/usr*" $IGNORE_COVERAGE -o "{}"_1
- mv Chapter01/01_A_program_options_base/tmp_coverage.info_1 $TRAVIS_BUILD_DIR/coverals/coverage.info
- find Chapter*/ -name tmp_coverage.info_1 -print0 | xargs -0 -I {} sh -c "($LCOV -a $TRAVIS_BUILD_DIR/coverals/coverage.info -a '{}' --output-file $TRAVIS_BUILD_DIR/coverals/new_coverage.info && mv -f $TRAVIS_BUILD_DIR/coverals/new_coverage.info $TRAVIS_BUILD_DIR/coverals/coverage.info)|| :"
# Sending data to Coveralls
- cd $TRAVIS_BUILD_DIR
- gem install coveralls-lcov
- coveralls-lcov --repo-token "cuZr7V4LxFwjPi8WWKPxad9TBVUoDv0uH" coverals/coverage.info
# Sending data to codecov.io
- bash <(curl -s https://codecov.io/bash)