Adjustments to code coverage reports:

* src/beast is removed since it has its own coverage and CI integration.
This commit is contained in:
Nicholas Dudfield
2016-05-01 16:35:13 +07:00
committed by Vinnie Falco
parent 92b3cdb6f8
commit 76b761d8e2
3 changed files with 29 additions and 5 deletions

View File

@@ -8,10 +8,10 @@ env:
# Note that for simplicity, BOOST_ROOT's final # Note that for simplicity, BOOST_ROOT's final
# namepart must match the folder name internal # namepart must match the folder name internal
# to boost's .tar.gz. # to boost's .tar.gz.
- LCOV_ROOT=$HOME/lcov
- BOOST_ROOT=$HOME/boost_1_60_0 - BOOST_ROOT=$HOME/boost_1_60_0
- BOOST_URL='http://downloads.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.60.0%2Fboost_1_60_0.tar.gz&ts=1460417589&use_mirror=netix' - BOOST_URL='http://downloads.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.60.0%2Fboost_1_60_0.tar.gz&ts=1460417589&use_mirror=netix'
packages: &gcc5_pkgs packages: &gcc5_pkgs
- gcc-5 - gcc-5
- g++-5 - g++-5

View File

@@ -21,6 +21,13 @@ rm -f build/rippled
# See what we've actually built # See what we've actually built
ldd $RIPPLED_PATH ldd $RIPPLED_PATH
if [[ $TARGET == "coverage" ]]; then
export PATH=$PATH:$LCOV_ROOT/usr/bin
# Create baseline coverage data file
lcov --no-external -c -i -d . -o baseline.info
fi
# Execute unit tests under gdb, printing a call stack # Execute unit tests under gdb, printing a call stack
# if we get a crash. # if we get a crash.
gdb -return-child-result -quiet -batch \ gdb -return-child-result -quiet -batch \
@@ -32,8 +39,17 @@ gdb -return-child-result -quiet -batch \
--args $RIPPLED_PATH --unittest --args $RIPPLED_PATH --unittest
if [[ $TARGET == "coverage" ]]; then if [[ $TARGET == "coverage" ]]; then
# We pass along -p to keep path segments so as to avoid collisions # Create test coverage data file
codecov --gcov-args=-p --gcov-source-match='^src/(ripple|beast)' lcov --no-external -c -d . -o tests.info
# Combine baseline and test coverage data
lcov -a baseline.info -a tests.info -o lcov-all.info
# Only report on src/ripple files
lcov -e "lcov-all.info" "*/src/ripple/*" -o lcov.info
# Push the results (lcov.info) to codecov
codecov -X gcov # don't even try and look for .gcov files ;)
fi fi
# Run NPM tests # Run NPM tests

View File

@@ -28,7 +28,15 @@ fi
ls -lah ~/.npm || mkdir ~/.npm ls -lah ~/.npm || mkdir ~/.npm
# Make sure we own it # Make sure we own it
chown -Rc $USER ~/.npm chown -Rc $USER ~/.npm
# We use this so we can filter the subtrees from our coverage report pip install --user https://github.com/codecov/codecov-python/archive/master.zip
pip install --user https://github.com/sublimator/codecov-python/zipball/source-match
bash bin/sh/install-boost.sh bash bin/sh/install-boost.sh
# Install lcov
# Download the archive
wget http://downloads.sourceforge.net/ltp/lcov-1.12.tar.gz
# Extract to ~/lcov-1.12
tar xfvz lcov-1.12.tar.gz -C $HOME
# Set install path
mkdir -p $LCOV_ROOT
cd $HOME/lcov-1.12 && make install PREFIX=$LCOV_ROOT