Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add "coverage" profile to cargo #3606

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,16 @@ members = [
]

exclude = ["implementations/rust/ockam/ockam_examples/example_projects"]

# Coverage profile for generating code coverage with grcov.
#
# See https://github.com/rust-lang/rust/issues/78011.
#
[profile.coverage]
panic = "abort"
opt-level = 0
overflow-checks = false
incremental = false
codegen-units = 1
inherits = "test"

2 changes: 1 addition & 1 deletion implementations/rust/DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Get a code coverage report:
```
cargo +nightly install grcov

env CARGO_INCREMENTAL=0 RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort --cfg tokio_unstable" RUSTDOCFLAGS="-Cpanic=abort" cargo +nightly test
env CARGO_INCREMENTAL=0 RUSTFLAGS="-Zprofile -Clink-dead-code --cfg tokio_unstable" cargo +nightly test --profile coverage

grcov --llvm . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/

Expand Down