Revive code coverage

This commit is contained in:
Greg Fitzgerald
2018-09-01 14:05:12 -10:00
committed by Grimes
parent c79acac37b
commit 5bc01cd51a
2 changed files with 26 additions and 12 deletions

View File

@ -12,7 +12,7 @@ steps:
- command: "ci/shellcheck.sh"
name: "shellcheck [public]"
timeout_in_minutes: 20
- command: "ci/docker-run.sh solanalabs/rust-nightly:2018-09-28 ci/test-nightly.sh || true"
- command: "ci/docker-run.sh solanalabs/rust-nightly:2018-09-28 ci/test-nightly.sh"
name: "nightly [public]"
env:
CARGO_TARGET_CACHE_NAME: "nightly"

View File

@ -13,17 +13,31 @@ _() {
_ cargo build --verbose --features unstable
_ cargo test --verbose --features=unstable
exit 0
maybe_cargo_install() {
for cmd in "$@"; do
set +e
cargo "$cmd" --help > /dev/null 2>&1
declare exitcode=$?
set -e
if [[ $exitcode -eq 101 ]]; then
_ cargo install cargo-"$cmd"
fi
done
}
# Coverage disabled (see issue #433)
_ cargo cov test
_ cargo cov report
maybe_cargo_install cov
echo --- Coverage report:
ls -l target/cov/report/index.html
_ cargo cov clean
_ cargo cov test --lib
if [[ -z "$CODECOV_TOKEN" ]]; then
echo CODECOV_TOKEN undefined
else
bash <(curl -s https://codecov.io/bash) -x 'llvm-cov-6.0 gcov'
fi
# TODO: Fix `cargo cov report` in Docker.
#_ cargo cov report
#
#echo --- Coverage report:
#ls -l target/cov/report/index.html
#
#if [[ -z "$CODECOV_TOKEN" ]]; then
# echo CODECOV_TOKEN undefined
#else
# bash <(curl -s https://codecov.io/bash) -x 'llvm-cov-6.0 gcov'
#fi