From f4092e947c630c9e62577e0da97b7e62b979732b Mon Sep 17 00:00:00 2001 From: karanabe <152078880+karanabe@users.noreply.github.com> Date: Sun, 3 Aug 2025 06:03:02 +0900 Subject: [PATCH] docs: replace -Zprofile with instrument-coverage (#1245) * docs: replace -Zprofile with instrument-coverage * docs: update coverage instructions to include submodules and cleanup profraw * gitignore drop profraw patterns --- CONTRIBUTING.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ec6c8a..2eb5909 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -182,14 +182,17 @@ Test coverage can be checked using [grcov](https://github.com/mozilla/grcov). I ```sh cargo install grcov +rustup component add llvm-tools rustup install nightly rustup default nightly 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 RUSTFLAGS="-Cinstrument-coverage -Clink-dead-code -Ccodegen-units=1 -Coverflow-checks=off" +export LLVM_PROFILE_FILE="target/debug/coverage/profraw/feroxbuster-%p-%m.profraw" export RUSTDOCFLAGS="-Cpanic=abort" +rm -r target/debug/coverage/profraw cargo build cargo test -grcov ./target/debug/ -s . -t html --llvm --branch --ignore-not-existing -o ./target/debug/coverage/ +grcov . --source-dir . --keep-only "src/*" --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/ firefox target/debug/coverage/index.html ```