mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 04:46:29 +03:00
Add coverage script
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -26,3 +26,5 @@ deltachat-ffi/html
|
|||||||
deltachat-ffi/xml
|
deltachat-ffi/xml
|
||||||
|
|
||||||
.rsynclist
|
.rsynclist
|
||||||
|
|
||||||
|
coverage/
|
||||||
|
|||||||
26
ci_scripts/coverage.sh
Executable file
26
ci_scripts/coverage.sh
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
if ! which grcov 2>/dev/null 1>&2; then
|
||||||
|
echo >&2 '`grcov` not found. Check README at https://github.com/mozilla/grcov for setup instructions.'
|
||||||
|
echo >&2 'Run `cargo install grcov` to build `grcov` from source.'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Allow `-Z` flags without using nightly Rust.
|
||||||
|
export RUSTC_BOOTSTRAP=1
|
||||||
|
|
||||||
|
# We are using `-Zprofile` instead of source-based coverage [1]
|
||||||
|
# (`-Zinstrument-coverage`) due to a bug resulting in empty reports [2].
|
||||||
|
#
|
||||||
|
# [1] https://blog.rust-lang.org/inside-rust/2020/11/12/source-based-code-coverage.html
|
||||||
|
# [2] https://github.com/mozilla/grcov/issues/595
|
||||||
|
|
||||||
|
export CARGO_INCREMENTAL=0
|
||||||
|
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
|
||||||
|
export RUSTDOCFLAGS="-Cpanic=abort"
|
||||||
|
cargo clean
|
||||||
|
cargo build
|
||||||
|
cargo test
|
||||||
|
|
||||||
|
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./coverage/
|
||||||
Reference in New Issue
Block a user