Skip to content

Commit 0de0697

Browse files
authored
CONTRIBUTING: document the test coverage tool (#2566)
1 parent 7a4efa2 commit 0de0697

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,25 @@ background, and it's invalidating the build cache. To prevent this, you need
141141
to configure your IDE for Verus development. See above for how to do
142142
this for VS Code.
143143
144+
### Measuring test coverage
145+
146+
`tools/coverage.sh` reports how much of the verifier the `rust_verify_test`
147+
suite exercises. Run it from `source/`:
148+
149+
```
150+
./tools/coverage.sh # whole suite
151+
./tools/coverage.sh --test bitvector # narrow to one suite
152+
```
153+
154+
This writes the reports to `coverage/`. Open `coverage/index.html` in a browser
155+
for the annotated source view, or read the text summary with `cat
156+
coverage/coverage.txt`. An `lcov` file (`coverage/coverage.lcov`) is also
157+
written for external tools.
158+
159+
The tests run the verifier as a spawned subprocess, so the script instruments
160+
that `rust_verify` binary (not the test binary), and gathers coverage from those
161+
processes.
162+
144163
## Contributing to the standard library (`vstd`)
145164
146165
### What to contribute

0 commit comments

Comments
 (0)