add support for codecov.io

This commit is contained in:
arvidn 2015-12-15 21:07:26 -05:00 committed by arvidn
parent 0b04cb4ee0
commit 49b5a0d7d9
4 changed files with 31 additions and 33 deletions

View File

@ -5,10 +5,10 @@ os:
- osx
env:
- variant=test_debug lang=cpp11 sim=1
- variant=test_debug lang=cpp98 sim=0
- variant=test_release lang=cpp11 sim=0
- variant=test_barebones lang=cpp11 sim=0
- variant=test_release lang=cpp11 sim=0 coverage=1
- variant=test_debug lang=cpp11 sim=1 coverage=0
- variant=test_debug lang=cpp98 sim=0 coverage=0
- variant=test_barebones lang=cpp11 sim=0 coverage=0
git:
submodules: false
@ -45,10 +45,24 @@ before_install:
- if [ $TRAVIS_OS_NAME == "osx" ]; then export toolset="darwin-${lang}"; export sim="0"; fi
- if [ $TRAVIS_OS_NAME == "osx" ]; then export target="osx-tests"; fi
- if [ $TRAVIS_OS_NAME == "linux" ]; then export toolset="gcc-${lang}"; fi
- if [[ $TRAVIS_OS_NAME == "linux" && $coverage == "1" ]]; then
export coverage_toolset=gcc-coverage;
pip install --user codecov;
else
export coverage_toolset=$toolset;
fi
- 'echo "using toolset: " ${toolset}'
after_success:
- if [[ $TRAVIS_OS_NAME == "linux" && $coverage == "1" ]]; then
cd test;
codecov --root .. --gcov-exec gcov-4.8;
fi
install:
- g++-4.8 --version
- 'echo "using gcc : cpp11 : ccache g++-4.8 : <cflags>-std=c11 <cxxflags>-std=c++11 ;" > ~/user-config.jam'
- 'echo "using gcc : coverage : ccache g++-4.8 : <cflags>-std=c11 <cxxflags>-std=c++11 <compileflags>--coverage <linkflags>--coverage ;" >> ~/user-config.jam'
- 'echo "using gcc : cpp98 : ccache g++-4.8 : <cflags>-std=c99 <cxxflags>-std=c++98 ;" >> ~/user-config.jam'
# osx builds need to disable the deprecated warning because of the openssl
@ -61,21 +75,27 @@ install:
script:
- cd test
- bjam --hash -j3 warnings-as-errors=on variant=$variant -l900 $toolset $target
- bjam --hash -j3 warnings-as-errors=on variant=$variant -l900 $coverage_toolset $target
- cd ../examples
- bjam --hash -j3 warnings-as-errors=on variant=$variant $toolset link=shared
- cd ..
# build libtorrent separately and install it in a temporary (well known) dir
# we have to do this because on linux the name of the python module is the same
# as the main library, so we can't stage them to the same directory
- bjam --hash -j3 warnings-as-errors=on link=shared variant=$variant $toolset install location=./lib
- cd bindings/python
# here we specify the temporary lib dir as a path to look for the main library
- bjam --hash -j3 warnings-as-errors=on variant=$variant $toolset stage_module libtorrent-link=shared install-type=LIB dll-path=../../lib
- LD_LIBRARY_PATH=../../lib DYLD_LIBRARY_PATH=../../lib python test.py
- cd ../..
- if [ $sim = "1" ]; then
cd ../../simulation;
bjam --hash -j2 crypto=built-in $toolset;
cd simulation;
bjam --hash -j2 crypto=built-in $coverage_toolset;
cd ..;
fi
- ccache --show-stats

25
Jamfile
View File

@ -60,28 +60,6 @@ else
VERSION = 1.1.0 ;
rule coverage ( properties * )
{
local result ;
if <test-coverage>on in $(properties)
&& ( <toolset>gcc in $(properties)
|| <toolset>darwin in $(properties)
|| <toolset>clang in $(properties) )
{
result += <cxxflags>-fprofile-arcs <cxxflags>-ftest-coverage ;
if <toolset>gcc in $(properties)
{
result += <linkflags>-lgcov ;
}
else
{
result += <linkflags>--coverage ;
}
}
return $(result) ;
}
# rule for linking the correct libraries depending
# on features and target-os
rule linking ( properties * )
@ -506,8 +484,6 @@ feature boost-link : default static shared : propagated composite ;
feature debug-iterators : off on : composite propagated link-incompatible ;
feature.compose <debug-iterators>on : <define>_SCL_SECURE=1 <define>_GLIBCXX_DEBUG ;
feature test-coverage : off on : composite propagated link-incompatible ;
feature fpic : off on : composite propagated link-incompatible ;
feature.compose <fpic>on : <cflags>-fPIC ;
feature.compose <fpic>off : <toolset>darwin:<cflags>-mdynamic-no-pic ;
@ -736,7 +712,6 @@ local usage-requirements =
# enable cancel support in asio
<define>BOOST_ASIO_ENABLE_CANCELIO
<conditional>@linking
<conditional>@coverage
# these compiler settings just makes the compiler standard conforming
<toolset>msvc:<cflags>/Zc:wchar_t
<toolset>msvc:<cflags>/Zc:forScope

View File

@ -7,6 +7,9 @@ libtorrent
.. image:: https://ci.appveyor.com/api/projects/status/w7teauvub5813mew/branch/master?svg=true
:target: https://ci.appveyor.com/project/arvidn/libtorrent/branch/master
.. image:: https://codecov.io/github/arvidn/libtorrent/coverage.svg?branch=master
:target: https://codecov.io/github/arvidn/libtorrent?branch=master
.. image:: https://www.openhub.net/p/rasterbar-libtorrent/widgets/project_thin_badge.gif
:target: https://www.openhub.net/p/rasterbar-libtorrent?ref=sample

@ -1 +1 @@
Subproject commit 8417cbee7f1a813f032c5c1ed81e1f2881af7580
Subproject commit a6129b41688ae3caa667f0ac766080fbee28eb37