Merge pull request #297 from dongcarl/2019-07-codecov

Generate codecov.io reports
This commit is contained in:
Andrew Poelstra 2019-07-29 12:32:45 +00:00 committed by GitHub
commit caae4b7a3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 4 deletions

View File

@ -1,12 +1,23 @@
language: rust language: rust
before_install:
- sudo apt-get -qq update addons:
- sudo apt-get install -y binutils-dev libunwind8-dev apt:
update: true
packages:
- binutils-dev
- libunwind8-dev
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- cmake
- gcc
- libiberty-dev
matrix: matrix:
include: include:
- rust: stable - rust: stable
env: DO_FUZZ=true env: DO_FUZZ=true DO_COV=true
- rust: beta - rust: beta
- rust: nightly - rust: nightly
env: DO_BENCH=true env: DO_BENCH=true
@ -14,3 +25,19 @@ matrix:
script: script:
- ./contrib/test.sh - ./contrib/test.sh
after_success: |
if [ "$DO_COV" = true ]; then
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
tar xzf master.tar.gz &&
cd kcov-master &&
mkdir build &&
cd build &&
cmake .. &&
make &&
make install DESTDIR=../../kcov-build &&
cd ../.. &&
rm -rf kcov-master &&
for file in target/debug/bitcoin-*; do [ -x "${file}" ] || continue; mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done &&
bash <(curl -s https://codecov.io/bash) &&
echo "Uploaded code coverage"; fi

View File

@ -2,6 +2,12 @@
FEATURES="bitcoinconsensus use-serde" FEATURES="bitcoinconsensus use-serde"
if [ "$DO_COV" = true ]
then
export RUSTFLAGS="-C link-dead-code"
fi
# Use toolchain if explicitly specified # Use toolchain if explicitly specified
if [ -n "$TOOLCHAIN" ] if [ -n "$TOOLCHAIN" ]
then then