turtle/.travis.yml
2015-03-31 16:48:54 +02:00

80 lines
3.2 KiB
YAML

# 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.
#
# See https://svn.boost.org/trac/boost/wiki/TravisCoverals for description of this file
# and how it can be used with Boost libraries.
#
os:
- linux
env:
- CXX_STANDARD=c++98
- CXX_STANDARD=c++0x
before_install:
# Set this to the name of your Boost library
# Autodetect library name by using the following code: - PROJECT_TO_TEST=$(basename $(pwd))
- PROJECT_TO_TEST=$(basename $(pwd))
# 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=master
# Files, which coverage results must be ignored (files from other projects). Example: - IGNORE_COVERAGE='*/boost/progress.hpp */filesystem/src/path.cpp'
- IGNORE_COVERAGE='*/boost/progress.hpp */filesystem/src/path.cpp */numeric/conversion/converter_policies.hpp'
# From this point and below code is same for all the Boost libs
# 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
- 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
- sudo apt-get install -qq xsltproc
script:
- if [ "$CCFLAGS" != "" ]; then FLAGS="cxxflags=\"$CCFLAGS\" linkflags=\"$LINKFLAGS\""; else FLAGS=""; fi
- cd $PROJECT_DIR/build
# `--coverage` flags required to generate coverage info for Coveralls
# ../../../b2 -q cxxflags="--coverage -std=$CXX_STANDARD" linkflags="--coverage"
- export BOOST_ROOT=$BOOST
- ./build.sh cxxflags="--coverage -std=$CXX_STANDARD" linkflags="--coverage"
after_success:
- COVERALS_DIR=$PROJECT_DIR/coverals
# Copying Coveralls data to a separate folder
- mkdir -p $COVERALS_DIR
- find ../test/bin/ -name "*.gcda" -exec cp "{}" $COVERALS_DIR/ \;
- find ../test/bin/ -name "*.gcno" -exec cp "{}" $COVERALS_DIR/ \;
# Preparing Coveralls data by
# ... installing the tools
- sudo apt-get install -qq python-yaml lcov
# ... changing data format to a readable one
- lcov --directory $COVERALS_DIR --base-directory /home/travis/build/mat007/turtle/test --capture --output-file $COVERALS_DIR/coverage.info
# ... erasing /test/ /example/ folder data
- lcov --remove $COVERALS_DIR/coverage.info "/usr*" "/test/*" $IGNORE_COVERAGE "tests/*" "*/doc/examples/*" -o $COVERALS_DIR/coverage.info
# Sending data to Coveralls
- cd $PROJECT_DIR
- gem install coveralls-lcov
- coveralls-lcov coverals/coverage.info