This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
.travis.yml
136 lines (114 loc) · 5.34 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# 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-2015.
#
# See https://svn.boost.org/trac/boost/wiki/TravisCoverals for description of this file
# and how it can be used with Boost libraries.
#
# File revision #2
language: cpp
os:
- linux
matrix:
include:
- compiler: gcc
env:
- GCC_VERSION="4.9"
- TOOLSET=gcc-4.9
- LIBCXX="libstdc++"
- STDLIB_LIBCXX=""
- CXX_STANDARD=c++1y
- compiler: clang
env:
- TOOLSET=clang
- LIBCXX="libc++"
- CXX_STANDARD=c++1y
- STDLIB_LIBCXX="-stdlib=$LIBCXX"
env:
global:
# Autodetect Boost branch by using the following code: - BRANCH_TO_TEST=`git rev-parse --abbrev-ref HEAD`
# or by - BRANCH_TO_TEST=$TRAVIS_BRANCH or just directly specify it
- BRANCH_TO_TEST=$TRAVIS_BRANCH
# Files, which coverage results must be ignored (files from other projects).
# Example: - IGNORE_COVERAGE='*/boost/progress.hpp */filesystem/src/*'
- IGNORE_COVERAGE=''
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key.
#
# You can get it from "Configure TravisCI" on your Coverity project page
#- secure: "WJQ9X51EmtIKOe7LTAKsGx/RTq60ENxSRdTvoJ2MWMHzD0+8mW32Qki60zXBaOrKuNAa0rBWj1dVIgKBxpQdWHJgSdZbBJzQ+ZLUVHB1fFMp/P8IITywceTdBw2WMqWML8pBpcXM/+mQXr+xjAVDDxcQ+7f7HKna4T7S3daN5x4="
before_install:
#######################
- echo "Installing GCC"
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update -qq
- if [ -n "$GCC_VERSION" ]; then sudo apt-get install -qq g++-${GCC_VERSION}; fi
- if [ "$CXX" = "g++" ]; then export CXX="g++-${GCC_VERSION}" CC="gcc-${GCC_VERSION}"; fi
#######################
# Install libc++
- if [ "$LIBCXX" = "libc++" ]; then echo "Installing libc++"; fi
- if [ "$LIBCXX" = "libc++" ]; then svn co --quiet http://llvm.org/svn/llvm-project/libcxx/trunk libcxx; fi
- if [ "$LIBCXX" = "libc++" ]; then cd libcxx/lib && bash buildit; fi
- if [ "$LIBCXX" = "libc++" ]; then sudo cp ./libc++.so.1.0 /usr/lib/; fi
- if [ "$LIBCXX" = "libc++" ]; then sudo mkdir /usr/include/c++/v1; fi
- if [ "$LIBCXX" = "libc++" ]; then cd .. && sudo cp -r include/* /usr/include/c++/v1/; fi
- if [ "$LIBCXX" = "libc++" ]; then cd /usr/lib && sudo ln -sf libc++.so.1.0 libc++.so; fi
- if [ "$LIBCXX" = "libc++" ]; then sudo ln -sf libc++.so.1.0 libc++.so.1 && cd $cwd; fi
#######################
# Cloning Boost libraries (fast nondeep cloning)
- BOOST=$HOME/boost-local
- PATH=$BOOST:$PATH
- BOOST_ROOT=$BOOST
- BOOST_BUILD_PATH=$BOOST/tools/build
- git init $BOOST
- cd $BOOST
- pwd
- 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
- git remote set-branches --add origin $BRANCH_TO_TEST
- git pull --recurse-submodules
- git submodule update --init
- 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
#######################
- env
- clang --version
- which gcc-4.9
#######################
# Set this to the name of the library
- PROJECT_TO_TEST=`basename $TRAVIS_BUILD_DIR`
script:
#######################
- echo "Testing $PROJECT_TO_TEST"
- cd $TRAVIS_BUILD_DIR/test
# `--coverage` flags required to generate coverage info for Coveralls
- $BOOST/b2 toolset=$TOOLSET -sBOOST_ROOT=$BOOST cxxflags="--coverage -std=$CXX_STANDARD $STDLIB_LIBCXX" linkflags="--coverage $STDLIB_LIBCXX"
after_success:
# Copying Coveralls data to a separate folder
- mkdir -p $TRAVIS_BUILD_DIR/coverals
- find bin/ -name "*.gcda" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \;
- find bin/ -name "*.gcno" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \;
# Preparing Coveralls data by
# ... installing the tools
- sudo apt-get install -qq python-yaml lcov
# ... changind data format to a readable one
- lcov --directory $TRAVIS_BUILD_DIR/coverals --base-directory ./ --capture --output-file $TRAVIS_BUILD_DIR/coverals/coverage.info
# ... erasing /test/ /example/ folder data
#- lcov --remove $TRAVIS_BUILD_DIR/coverals/coverage.info "/usr*" "$TRAVIS_BUILD_DIR/test/*" $IGNORE_COVERAGE "$TRAVIS_BUILD_DIR/tests/*" "$TRAVIS_BUILD_DIR/examples/*" "$TRAVIS_BUILD_DIR/example/*" -o $TRAVIS_BUILD_DIR/coverals/coverage.info
# ... erasing data that is not related to this project directly
#- cd $BOOST
#- OTHER_LIBS=`grep "submodule .*" .gitmodules | sed 's/\[submodule\ "\(.*\)"\]/"\*\/boost\/\1\.hpp" "\*\/boost\/\1\/\*"/g'| sed "/\"\*\/boost\/$PROJECT_TO_TEST\/\*\"/d" | sed ':a;N;$!ba;s/\n/ /g'`
#- echo $OTHER_LIBS
#- eval "lcov --remove $TRAVIS_BUILD_DIR/coverals/coverage.info $OTHER_LIBS -o $TRAVIS_BUILD_DIR/coverals/coverage.info"
# Sending data to Coveralls
- cd $TRAVIS_BUILD_DIR
- gem install coveralls-lcov
- coveralls-lcov coverals/coverage.info