From 9d59280146a984f54b1f4a5264d20625e08acbe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20S=2E=20Ga=C3=9Fmann?= Date: Tue, 29 Dec 2015 14:32:34 +0100 Subject: [PATCH 1/3] ADD NEWEST REVISION OF .travis.yml FOR BOOST LIBS See https://svn.boost.org/trac/boost/wiki/TravisCoverals . Switch to travis trusty distribution in order to get gcc 4.8 an passable C++11 support. --- .travis.yml | 92 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e7f63b..3999c1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,27 +2,65 @@ # 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. +# 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 #5 + +sudo: required +dist: trusty +language: cpp +compiler: + - gcc +# - clang os: - linux env: - - CXX_STANDARD=c++98 - - CXX_STANDARD=c++0x + global: + # Autodetect Boost branch by using the following code: - 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='*/thread/src/* */filesystem/src/*' + + # Explicitly remove the following library from Boost. This may be usefull, if you're for example running Travis + # from `Boost.DLL` repo, while Boost already has `dll`. + # + # By default is eaual to - BOOST_REMOVE=$(basename $TRAVIS_BUILD_DIR) + # This will force to use local repo content, instead of the Boost's default. + - BOOST_REMOVE=$(basename $TRAVIS_BUILD_DIR) + + matrix: + - CXX_STANDARD=c++98 + - CXX_STANDARD=c++11 + +############################################################################################################### +# From this point and below code is same for all the Boost libs +############################################################################################################### + + +# Installing additional tools +addons: + apt: + packages: + - valgrind + - python-yaml + - lcov before_install: - # Set this to the name of your Boost library - # Autodetect library name by using the following code: - PROJECT_TO_TEST=`git rev-parse --show-toplevel` + # Set this to the name of the library - PROJECT_TO_TEST=application - # Autodetect branch - - BRANCH_TO_TEST=$TRAVIS_BRANCH - BOOST_BRANCH_TO_TEST=master - - # 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 + - echo "Testing $PROJECT_TO_TEST, to remove $BOOST/libs/$BOOST_REMOVE, testing branch $BRANCH_TO_TEST" - git init $BOOST - cd $BOOST - git remote add --no-tags -t $BOOST_BRANCH_TO_TEST origin https://github.com/boostorg/boost.git @@ -36,42 +74,38 @@ before_install: - git submodule foreach "git reset --quiet --hard; git clean -fxd" - git reset --hard; git clean -fxd - git status - - rm -rf $BOOST/libs/$PROJECT_TO_TEST - - mv $PROJECT_DIR/../Boost.Application/ $BOOST/libs/$PROJECT_TO_TEST - - PROJECT_DIR=$BOOST/libs/$PROJECT_TO_TEST + - rm -rf $BOOST/libs/$BOOST_REMOVE + - mv $TRAVIS_BUILD_DIR $BOOST/libs/$PROJECT_TO_TEST + - TRAVIS_BUILD_DIR=$BOOST/libs/$PROJECT_TO_TEST - ./bootstrap.sh - ./b2 headers - -script: - - if [ "$CCFLAGS" != "" ]; then FLAGS="cxxflags=\"$CCFLAGS\" linkflags=\"$LINKFLAGS\""; else FLAGS=""; fi - cd $BOOST/libs/$PROJECT_TO_TEST/test/ # remove my env specific files - rm ../Jamroot.jam ../boost-build.jam + +script: # `--coverage` flags required to generate coverage info for Coveralls - - ../../../b2 cxxflags="--coverage -std=$CXX_STANDARD" linkflags="--coverage" link=shared + - ../../../b2 testing.launcher=valgrind address-model=64 architecture=x86 toolset=$CC cxxflags="--coverage -DBOOST_TRAVISCI_BUILD -std=$CXX_STANDARD" linkflags="--coverage" after_success: # Copying Coveralls data to a separate folder - - mkdir -p $PROJECT_DIR/coverals - - find ../../../bin.v2/ -name "*.gcda" -exec cp "{}" $PROJECT_DIR/coverals/ \; - - find ../../../bin.v2/ -name "*.gcno" -exec cp "{}" $PROJECT_DIR/coverals/ \; + - mkdir -p $TRAVIS_BUILD_DIR/coverals + - find ../../../bin.v2/ -name "*.gcda" -exec cp "{}" $TRAVIS_BUILD_DIR/coverals/ \; + - find ../../../bin.v2/ -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 $PROJECT_DIR/coverals --base-directory ./ --capture --output-file $PROJECT_DIR/coverals/coverage.info + # Preparing Coveralls data by 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 - cd $BOOST - - lcov --remove $PROJECT_DIR/coverals/coverage.info "/usr*" "*/$PROJECT_TO_TEST/test/*" "*/$PROJECT_TO_TEST/tests/*" "*/$PROJECT_TO_TEST/examples/*" "*/$PROJECT_TO_TEST/example/*" -o $PROJECT_DIR/coverals/coverage.info + - 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 # ... erasing data that is not related to this project directly - 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 $PROJECT_DIR/coverals/coverage.info $OTHER_LIBS -o $PROJECT_DIR/coverals/coverage.info" + - eval "lcov --remove $TRAVIS_BUILD_DIR/coverals/coverage.info $OTHER_LIBS -o $TRAVIS_BUILD_DIR/coverals/coverage.info" # Sending data to Coveralls - - cd $PROJECT_DIR + - cd $TRAVIS_BUILD_DIR - gem install coveralls-lcov - - coveralls-lcov coverals/coverage.info + - coveralls-lcov coverals/coverage.info \ No newline at end of file From 67e2ffe6c945246b8eab98ec4db53ae4191c6181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20S=2E=20Ga=C3=9Fmann?= Date: Tue, 29 Dec 2015 17:08:02 +0100 Subject: [PATCH 2/3] FIX tutorial 4 Add missing include. --- example/tutorial/myfunctor_stage4.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/example/tutorial/myfunctor_stage4.hpp b/example/tutorial/myfunctor_stage4.hpp index 5149c41..ff3b599 100644 --- a/example/tutorial/myfunctor_stage4.hpp +++ b/example/tutorial/myfunctor_stage4.hpp @@ -13,6 +13,7 @@ #define BOOST_APPLICATION_FEATURE_NS_SELECT_BOOST #include +#include #include using namespace boost; From a30146d84a5a1460f0cdc5b0359aa70818aad13c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20S=2E=20Ga=C3=9Fmann?= Date: Tue, 29 Dec 2015 17:23:05 +0100 Subject: [PATCH 3/3] FIX selfpipe EXAMPLE --- example/selfpipe/selfpipe.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/selfpipe/selfpipe.cpp b/example/selfpipe/selfpipe.cpp index 97afc6d..c67e12c 100644 --- a/example/selfpipe/selfpipe.cpp +++ b/example/selfpipe/selfpipe.cpp @@ -133,12 +133,12 @@ class signal_usr2 : public application::signal_manager /*<< Customize SIGNALS bind >>*/ signal_usr2(application::global_context_ptr cxt) - : application::signal_manager(cxt) + : application::signal_manager(*cxt) { - application::handler<>::parameter_callback callback1 + application::handler<>::callback callback1 = boost::bind(&signal_usr2::signal_usr1_handler, this); - application::handler<>::parameter_callback callback2 + application::handler<>::callback callback2 = boost::bind(&signal_usr2::signal_usr2_handler, this); /*<< Define signal bind >>*/