]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | # Use, modification, and distribution are |
2 | # subject to the Boost Software License, Version 1.0. (See accompanying | |
3 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
4 | # | |
5 | # Copyright Antony Polukhin 2014-2016. | |
6 | ||
7 | # | |
8 | # See https://svn.boost.org/trac/boost/wiki/TravisCoverals for description of this file | |
9 | # and how it can be used with Boost libraries. | |
10 | # | |
11 | # File revision #6 | |
12 | ||
13 | env: | |
14 | global: | |
15 | # Autodetect Boost branch by using the following code: - BRANCH_TO_TEST=$TRAVIS_BRANCH | |
16 | # or just directly specify it | |
17 | - BRANCH_TO_TEST=$TRAVIS_BRANCH | |
18 | ||
19 | # Files, which coverage results must be ignored (files from other projects). | |
20 | # Example: - IGNORE_COVERAGE='*/boost/progress.hpp */filesystem/src/*' | |
21 | - IGNORE_COVERAGE='*/detail/pe_info.hpp */detail/macho_info.hpp */boost/progress.hpp */src/unique_path.cpp */src/codecvt_error_category.cpp */src/portability.cpp */src/operations.cpp */src/path.cpp */src/path_traits.cpp' | |
22 | ||
23 | # Explicitly remove the following library from Boost. This may be usefull, if you're for example running Travis | |
24 | # from `Boost.DLL` repo, while Boost already has `dll`. | |
25 | # | |
26 | # By default is eaual to - BOOST_REMOVE=`basename $TRAVIS_BUILD_DIR` | |
27 | # This will force to use local repo content, instead of the Boost's default | |
28 | - BOOST_REMOVE=dll | |
29 | ||
30 | matrix: | |
31 | - CXX_STANDARD=c++98 TOOLSET=gcc | |
32 | - CXX_STANDARD=c++11 TOOLSET=gcc-5 | |
33 | - CXX_STANDARD=c++1y TOOLSET=gcc-5 | |
34 | ||
35 | ||
36 | ############################################################################################################### | |
37 | # From this point and below code is same for all the Boost libs | |
38 | ############################################################################################################### | |
39 | sudo: false | |
40 | language: cpp | |
41 | compiler: | |
42 | - gcc | |
43 | ||
44 | os: | |
45 | - linux | |
46 | ||
47 | # Installing additional tools | |
48 | addons: | |
49 | apt: | |
50 | sources: | |
51 | - ubuntu-toolchain-r-test | |
52 | packages: | |
53 | - valgrind | |
54 | - python-yaml | |
55 | - gcc-5 | |
56 | - g++-5 | |
57 | - lcov | |
58 | - clang | |
59 | ||
60 | before_install: | |
61 | # Set this to the name of the library | |
62 | - PROJECT_TO_TEST=`basename $TRAVIS_BUILD_DIR` | |
63 | - echo "Testing $PROJECT_TO_TEST" | |
64 | # Cloning Boost libraries (fast nondeep cloning) | |
65 | - BOOST=$HOME/boost-local | |
66 | - git init $BOOST | |
67 | - cd $BOOST | |
68 | - git remote add --no-tags -t $BRANCH_TO_TEST origin https://github.com/boostorg/boost.git | |
69 | - git fetch --depth=1 | |
70 | - git checkout $BRANCH_TO_TEST | |
71 | - git submodule update --init --merge | |
72 | - git remote set-branches --add origin $BRANCH_TO_TEST | |
73 | - git pull --recurse-submodules | |
74 | - git submodule update --init | |
75 | - git checkout $BRANCH_TO_TEST | |
76 | - git submodule foreach "git reset --quiet --hard; git clean -fxd" | |
77 | - git reset --hard; git clean -fxd | |
78 | - git status | |
79 | - rm -rf $BOOST/libs/$BOOST_REMOVE | |
80 | - mv $TRAVIS_BUILD_DIR/../$PROJECT_TO_TEST/ $BOOST/libs/$PROJECT_TO_TEST | |
81 | - TRAVIS_BUILD_DIR=$BOOST/libs/$PROJECT_TO_TEST | |
82 | - ./bootstrap.sh | |
83 | - ./b2 headers | |
84 | - cd $BOOST/libs/$PROJECT_TO_TEST/test | |
85 | ||
86 | script: | |
87 | # `--coverage` flags required to generate coverage info for Coveralls | |
88 | - ../../../b2 testing.launcher=valgrind address-model=64 architecture=x86 toolset=$TOOLSET cxxflags="--coverage -DBOOST_TRAVISCI_BUILD -std=$CXX_STANDARD" linkflags="--coverage" -sBOOST_BUILD_PATH=. | |
89 | ||
90 | after_success: | |
91 | # Copying Coveralls data to a separate folder | |
92 | - mkdir -p $TRAVIS_BUILD_DIR/coverals | |
93 | - find ../../../bin.v2/ -name "*.gcda" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \; | |
94 | - find ../../../bin.v2/ -name "*.gcno" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \; | |
95 | ||
96 | # Preparing Coveralls data by changind data format to a readable one | |
97 | - git clone https://github.com/linux-test-project/lcov.git lcov_dir | |
98 | - GCOV_VERSION="" | |
99 | - if [[ "$TOOLSET" == *"-"* ]]; then GCOV_VERSION="--gcov-tool gcov-${TOOLSET#*-}"; fi | |
100 | - LCOV="$BOOST/libs/$PROJECT_TO_TEST/test/lcov_dir/bin/lcov $GCOV_VERSION" | |
101 | - $LCOV --directory $TRAVIS_BUILD_DIR/coverals --base-directory ./ --capture --output-file $TRAVIS_BUILD_DIR/coverals/coverage.info | |
102 | ||
103 | # ... erasing /test/ /example/ folder data | |
104 | - cd $BOOST | |
105 | - echo $LCOV --remove $TRAVIS_BUILD_DIR/coverals/coverage.info "/usr*" "*/$PROJECT_TO_TEST/test/*" $IGNORE_COVERAGE "*/$PROJECT_TO_TEST/tests/*" "*/$PROJECT_TO_TEST/examples/*" "*/$PROJECT_TO_TEST/example/*" -o $TRAVIS_BUILD_DIR/coverals/coverage.info | |
106 | - $LCOV --remove $TRAVIS_BUILD_DIR/coverals/coverage.info "/usr*" "*/$PROJECT_TO_TEST/test/*" $IGNORE_COVERAGE "*/$PROJECT_TO_TEST/tests/*" "*/$PROJECT_TO_TEST/examples/*" "*/$PROJECT_TO_TEST/example/*" -o $TRAVIS_BUILD_DIR/coverals/coverage.info | |
107 | ||
108 | # ... erasing data that is not related to this project directly | |
109 | - 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'` | |
110 | - echo $OTHER_LIBS | |
111 | - eval "$LCOV --remove $TRAVIS_BUILD_DIR/coverals/coverage.info $OTHER_LIBS -o $TRAVIS_BUILD_DIR/coverals/coverage.info" | |
112 | ||
113 | # Sending data to Coveralls | |
114 | - cd $TRAVIS_BUILD_DIR | |
115 | - gem install coveralls-lcov | |
116 | - coveralls-lcov coverals/coverage.info |