diff --git a/scripts/coverage.sh b/scripts/coverage.sh index 127bff040f..ecc89a4994 100755 --- a/scripts/coverage.sh +++ b/scripts/coverage.sh @@ -12,6 +12,12 @@ source ci/_ : "${BUILDKITE_COMMIT:=local}" reportName="lcov-${BUILDKITE_COMMIT:0:9}" +if [[ -n $1 ]]; then + crate=--manifest-path=$1 +else + crate=--all +fi + coverageFlags=(-Zprofile) # Enable coverage coverageFlags+=("-Clink-dead-code") # Dead code should appear red in the report coverageFlags+=("-Ccodegen-units=1") # Disable ThinLTO which corrupts debuginfo (see [rustc issue #45511]). @@ -29,12 +35,12 @@ fi rm -rf target/cov/$reportName source ci/rust-version.sh nightly -_ cargo +$rust_nightly build --target-dir target/cov --all -_ cargo +$rust_nightly test --target-dir target/cov --lib --all -- --test-threads=1 +_ cargo +$rust_nightly build --target-dir target/cov "$crate" +_ cargo +$rust_nightly test --target-dir target/cov --lib "$crate" -- --test-threads=1 -_ scripts/fetch-grcov.sh echo "--- grcov" -./grcov target/cov/debug/deps/ > target/cov/lcov-full.info + +_ grcov target/cov/debug/deps/ > target/cov/lcov-full.info echo "--- filter-files-from-lcov" diff --git a/scripts/fetch-grcov.sh b/scripts/fetch-grcov.sh deleted file mode 100755 index 9b14544270..0000000000 --- a/scripts/fetch-grcov.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -set -e - -if [[ ! -x ./grcov ]]; then - uname=$(uname | tr '[:upper:]' '[:lower:]') - if [[ $uname = darwin ]]; then - uname="osx" - fi - uname_m=$(uname -m | tr '[:upper:]' '[:lower:]') - name=grcov-${uname}-${uname_m}.tar.bz2 - - wget "https://github.com/mozilla/grcov/releases/download/v0.3.2/$name" - tar xjf "$name" -fi - -ls -lh grcov