Skip to content

Commit

Permalink
Update coverage target and README (#104)
Browse files Browse the repository at this point in the history
- Updated coverage section of the README.
- Updated coverage target in Makefile to generate html report
  • Loading branch information
TomasArrachea authored Sep 11, 2024
1 parent 890564a commit 5046191
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ coverage:
$(MAKE) start-anvil > /dev/null &
sleep 4 # needed to wait for anvil setup to finish
cargo llvm-cov --lcov --output-path lcov.info --ignore-filename-regex='fireblocks/' --workspace
cargo llvm-cov report --html --ignore-filename-regex='fireblocks/'
docker stop anvil

deps:
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,17 @@ Here's how to generate test coverage reports:

Install llvm tools:
```
rustup component add llvm-tools-preview
make deps
```

Run the tests with coverage instrumentations:
```
cargo clean && mkdir -p coverage/ && rm -r coverage/*
CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='coverage/cargo-test-%p-%m.profraw' cargo test --no-fail-fast
make coverage
```

Install coverage report tool and run it:
Open the coverage html report in a web browser:
```
cargo install grcov
grcov . --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/coverage/
open target/llvm-cov/html/index.html
```

## Supported Rust Version
Expand Down

0 comments on commit 5046191

Please sign in to comment.