@ -29,6 +29,10 @@ scripts/coverage.sh
|
|||||||
report=coverage-"${CI_COMMIT:0:9}".tar.gz
|
report=coverage-"${CI_COMMIT:0:9}".tar.gz
|
||||||
mv target/cov/report.tar.gz "$report"
|
mv target/cov/report.tar.gz "$report"
|
||||||
upload-ci-artifact "$report"
|
upload-ci-artifact "$report"
|
||||||
|
|
||||||
|
gzip target/cov/coverage-stderr.log
|
||||||
|
upload-ci-artifact target/cov/coverage-stderr.log.gz
|
||||||
|
|
||||||
annotate --style success --context lcov-report \
|
annotate --style success --context lcov-report \
|
||||||
"lcov report: <a href=\"artifact://$report\">$report</a>"
|
"lcov report: <a href=\"artifact://$report\">$report</a>"
|
||||||
|
|
||||||
|
@ -14,13 +14,14 @@ reportName="lcov-${CI_COMMIT:0:9}"
|
|||||||
|
|
||||||
if [[ -n $1 ]]; then
|
if [[ -n $1 ]]; then
|
||||||
crate="--package $1"
|
crate="--package $1"
|
||||||
|
shift
|
||||||
else
|
else
|
||||||
crate="--all --exclude solana-local-cluster"
|
crate="--all --exclude solana-local-cluster"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
coverageFlags=(-Zprofile) # Enable coverage
|
coverageFlags=(-Zprofile) # Enable coverage
|
||||||
coverageFlags+=("-Clink-dead-code") # Dead code should appear red in the report
|
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]).
|
coverageFlags+=("-Ccodegen-units=1") # Disable code generation parallelism which is unsupported under -Zprofile (see [rustc issue #51705]).
|
||||||
coverageFlags+=("-Cinline-threshold=0") # Disable inlining, which complicates control flow.
|
coverageFlags+=("-Cinline-threshold=0") # Disable inlining, which complicates control flow.
|
||||||
coverageFlags+=("-Coverflow-checks=off") # Disable overflow checks, which create unnecessary branches.
|
coverageFlags+=("-Coverflow-checks=off") # Disable overflow checks, which create unnecessary branches.
|
||||||
|
|
||||||
@ -37,7 +38,9 @@ rm -rf target/cov/$reportName
|
|||||||
|
|
||||||
source ci/rust-version.sh nightly
|
source ci/rust-version.sh nightly
|
||||||
# shellcheck disable=SC2086 #
|
# shellcheck disable=SC2086 #
|
||||||
_ cargo +$rust_nightly test --target-dir target/cov --lib $crate
|
RUST_LOG=solana=trace _ cargo +$rust_nightly test --target-dir target/cov --lib --no-run $crate "$@"
|
||||||
|
# shellcheck disable=SC2086 #
|
||||||
|
RUST_LOG=solana=trace _ cargo +$rust_nightly test --target-dir target/cov --lib $crate "$@" 2> target/cov/coverage-stderr.log
|
||||||
|
|
||||||
echo "--- grcov"
|
echo "--- grcov"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user