Generate codecov.io reports

This commit is contained in:
Carl Dong 2019-07-26 15:23:02 -04:00
parent c93a70487f
commit 3207ac5ea7
No known key found for this signature in database
GPG Key ID: 0CC52153197991A5
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