diff --git a/.travis.yml b/.travis.yml index 61d2d4f281..701e3ebb1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,10 @@ env: # Note that for simplicity, BOOST_ROOT's final # namepart must match the folder name internal # to boost's .tar.gz. + - LCOV_ROOT=$HOME/lcov - 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' - packages: &gcc5_pkgs - gcc-5 - g++-5 diff --git a/bin/ci/ubuntu/build-and-test.sh b/bin/ci/ubuntu/build-and-test.sh index 3c74d9f790..1932ba665c 100755 --- a/bin/ci/ubuntu/build-and-test.sh +++ b/bin/ci/ubuntu/build-and-test.sh @@ -21,6 +21,13 @@ rm -f build/rippled # See what we've actually built 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 # if we get a crash. gdb -return-child-result -quiet -batch \ @@ -32,8 +39,17 @@ gdb -return-child-result -quiet -batch \ --args $RIPPLED_PATH --unittest if [[ $TARGET == "coverage" ]]; then - # We pass along -p to keep path segments so as to avoid collisions - codecov --gcov-args=-p --gcov-source-match='^src/(ripple|beast)' + # Create test coverage data file + 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 # Run NPM tests diff --git a/bin/ci/ubuntu/install-dependencies.sh b/bin/ci/ubuntu/install-dependencies.sh index 7a9dabc255..54d0f7b3d3 100755 --- a/bin/ci/ubuntu/install-dependencies.sh +++ b/bin/ci/ubuntu/install-dependencies.sh @@ -28,7 +28,15 @@ fi ls -lah ~/.npm || mkdir ~/.npm # Make sure we own it chown -Rc $USER ~/.npm -# We use this so we can filter the subtrees from our coverage report -pip install --user https://github.com/sublimator/codecov-python/zipball/source-match +pip install --user https://github.com/codecov/codecov-python/archive/master.zip 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