Changes between Version 7 and Version 8 of TravisCoverals
- Timestamp:
- Jan 5, 2016, 1:47:06 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TravisCoverals
v7 v8 73 73 74 74 75 === `.travis.yml` content ( 22.08.2015) ===75 === `.travis.yml` content (05.01.2016) === 76 76 {{{ 77 77 # Use, modification, and distribution are … … 85 85 # and how it can be used with Boost libraries. 86 86 # 87 # File revision #5 87 88 89 sudo: false 88 90 language: cpp 91 compiler: 92 - gcc 93 # - clang 94 89 95 os: 90 96 - linux 91 97 92 98 env: 93 - CXX_STANDARD=c++98 94 - CXX_STANDARD=c++0x 99 global: 100 # Autodetect Boost branch by using the following code: - BRANCH_TO_TEST=$TRAVIS_BRANCH 101 # or just directly specify it 102 - BRANCH_TO_TEST=$TRAVIS_BRANCH 103 104 # Files, which coverage results must be ignored (files from other projects). 105 # Example: - IGNORE_COVERAGE='*/boost/progress.hpp */filesystem/src/*' 106 - IGNORE_COVERAGE='' 107 108 # Explicitly remove the following library from Boost. This may be usefull, if you're for example running Travis 109 # from `Boost.DLL` repo, while Boost already has `dll`. 110 # 111 # By default is eaual to - BOOST_REMOVE=$(basename $TRAVIS_BUILD_DIR) 112 # This will force to use local repo content, instead of the Boost's default. 113 - BOOST_REMOVE=$(basename $TRAVIS_BUILD_DIR) 114 115 matrix: 116 - CXX_STANDARD=c++98 117 - CXX_STANDARD=c++0x 118 119 ############################################################################################################### 120 # From this point and below code is same for all the Boost libs 121 ############################################################################################################### 122 123 124 # Installing additional tools 125 addons: 126 apt: 127 packages: 128 - valgrind 129 - python-yaml 130 - lcov 95 131 96 132 before_install: 97 # Set this to the name of your Boost library 98 # Autodetect library name by using the following code: - PROJECT_TO_TEST=$(basename $(pwd)) 99 - PROJECT_TO_TEST=$(basename $(pwd)) 100 101 # Autodetect Boost branch by using the following code: - BRANCH_TO_TEST=`git rev-parse --abbrev-ref HEAD` 102 # or by - BRANCH_TO_TEST=$TRAVIS_BRANCH or just directly specify it 103 - BRANCH_TO_TEST=$TRAVIS_BRANCH 104 105 # Files, which coverage results must be ignored (files from other projects). Example: - IGNORE_COVERAGE='*/boost/progress.hpp */filesystem/src/path.cpp' 106 - IGNORE_COVERAGE='*/boost/progress.hpp */filesystem/src/path.cpp */numeric/conversion/converter_policies.hpp' 107 108 109 # From this point and below code is same for all the Boost libs 133 # Set this to the name of the library 134 - PROJECT_TO_TEST=`basename $TRAVIS_BUILD_DIR` 110 135 # Cloning Boost libraries (fast nondeep cloning) 111 - PROJECT_DIR=`pwd`112 136 - BOOST=$HOME/boost-local 137 - echo "Testing $PROJECT_TO_TEST, to remove $BOOST/libs/$BOOST_REMOVE, testing branch $BRANCH_TO_TEST" 113 138 - git init $BOOST 114 139 - cd $BOOST … … 124 149 - git reset --hard; git clean -fxd 125 150 - git status 126 - rm -rf $BOOST/libs/$ PROJECT_TO_TEST127 - mv $ PROJECT_DIR/../$PROJECT_TO_TEST/$BOOST/libs/$PROJECT_TO_TEST128 - PROJECT_DIR=$BOOST/libs/$PROJECT_TO_TEST151 - rm -rf $BOOST/libs/$BOOST_REMOVE 152 - mv $TRAVIS_BUILD_DIR $BOOST/libs/$PROJECT_TO_TEST 153 - TRAVIS_BUILD_DIR=$BOOST/libs/$PROJECT_TO_TEST 129 154 - ./bootstrap.sh 130 155 - ./b2 headers 131 - sudo apt-get update -qq 132 - sudo apt-get install -qq valgrind 156 - cd $BOOST/libs/$PROJECT_TO_TEST/test/ 133 157 134 158 script: 135 - if [ "$CCFLAGS" != "" ]; then FLAGS="cxxflags=\"$CCFLAGS\" linkflags=\"$LINKFLAGS\""; else FLAGS=""; fi136 - cd $BOOST/libs/$PROJECT_TO_TEST/test/137 159 # `--coverage` flags required to generate coverage info for Coveralls 138 - ../../../b2 testing.launcher=valgrind cxxflags="--coverage-std=$CXX_STANDARD" linkflags="--coverage"160 - ../../../b2 testing.launcher=valgrind address-model=64 architecture=x86 toolset=$CC cxxflags="--coverage -DBOOST_TRAVISCI_BUILD -std=$CXX_STANDARD" linkflags="--coverage" 139 161 140 162 after_success: 141 163 # Copying Coveralls data to a separate folder 142 - mkdir -p $ PROJECT_DIR/coverals143 - find ../../../bin.v2/ -name "*.gcda" -exec cp "{}" $ PROJECT_DIR/coverals/ \;144 - find ../../../bin.v2/ -name "*.gcno" -exec cp "{}" $ PROJECT_DIR/coverals/ \;164 - mkdir -p $TRAVIS_BUILD_DIR/coverals 165 - find ../../../bin.v2/ -name "*.gcda" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \; 166 - find ../../../bin.v2/ -name "*.gcno" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \; 145 167 146 # Preparing Coveralls data by 147 # ... installing the tools 148 - sudo apt-get install -qq python-yaml lcov 149 # ... changind data format to a readable one 150 - lcov --directory $PROJECT_DIR/coverals --base-directory ./ --capture --output-file $PROJECT_DIR/coverals/coverage.info 168 # Preparing Coveralls data by changind data format to a readable one 169 - lcov --directory $TRAVIS_BUILD_DIR/coverals --base-directory ./ --capture --output-file $TRAVIS_BUILD_DIR/coverals/coverage.info 151 170 152 171 # ... erasing /test/ /example/ folder data 153 172 - cd $BOOST 154 - lcov --remove $ PROJECT_DIR/coverals/coverage.info "/usr*" "*/$PROJECT_TO_TEST/test/*" $IGNORE_COVERAGE "*/$PROJECT_TO_TEST/tests/*" "*/$PROJECT_TO_TEST/examples/*" "*/$PROJECT_TO_TEST/example/*" -o $PROJECT_DIR/coverals/coverage.info173 - 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 155 174 156 175 # ... erasing data that is not related to this project directly 157 176 - 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'` 158 177 - echo $OTHER_LIBS 159 - eval "lcov --remove $ PROJECT_DIR/coverals/coverage.info $OTHER_LIBS -o $PROJECT_DIR/coverals/coverage.info"178 - eval "lcov --remove $TRAVIS_BUILD_DIR/coverals/coverage.info $OTHER_LIBS -o $TRAVIS_BUILD_DIR/coverals/coverage.info" 160 179 161 180 # Sending data to Coveralls 162 - cd $ PROJECT_DIR181 - cd $TRAVIS_BUILD_DIR 163 182 - gem install coveralls-lcov 164 183 - coveralls-lcov coverals/coverage.info