This repository was archived by the owner on Jan 22, 2025. It is now read-only.
File tree 4 files changed +17
-17
lines changed
4 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -234,12 +234,21 @@ $ cargo +nightly bench --features="unstable"
234
234
Code coverage
235
235
---
236
236
237
- To generate code coverage statistics, run kcov via Docker:
237
+ To generate code coverage statistics, install cargo-cov. Note: the tool currently only works
238
+ in Rust nightly.
238
239
239
240
``` bash
240
- $ ./ci/coverage.sh
241
+ $ cargo +nightly install cargo-cov
241
242
```
242
- The coverage report will be written to ` ./target/cov/index.html `
243
+
244
+ Run cargo-cov and generate a report:
245
+
246
+ ``` bash
247
+ $ cargo +nightly cov test
248
+ $ cargo +nightly cov report --open
249
+ ```
250
+
251
+ The coverage report will be written to ` ./target/cov/report/index.html `
243
252
244
253
245
254
Why coverage? While most see coverage as a code quality metric, we see it primarily as a developer
Original file line number Diff line number Diff line change 3
3
name : " stable [public]"
4
4
timeout_in_minutes : 20
5
5
- wait
6
- - command : " ci/coverage.sh"
7
- name : " coverage [public]"
8
- timeout_in_minutes : 20
9
- retry :
10
- automatic :
11
- - exit_status : " *"
12
- limit : 2
13
6
- command : " ci/docker-run.sh rustlang/rust:nightly ci/test-nightly.sh"
14
7
name : " nightly [public]"
15
8
timeout_in_minutes : 20
Original file line number Diff line number Diff line change 2
2
3
3
cd " $( dirname " $0 " ) /.."
4
4
5
- ci/docker-run.sh evilmachines/rust-cargo-kcov \
6
- bash -exc " \
7
- export RUST_BACKTRACE=1; \
8
- cargo build --verbose; \
9
- cargo kcov --lib --verbose; \
10
- "
5
+ cargo install cargo-cov
6
+ cargo cov test
7
+ cargo cov report
11
8
12
9
echo Coverage report:
13
- ls -l target/cov/index.html
10
+ ls -l target/cov/report/ index.html
14
11
15
12
if [[ -z " $CODECOV_TOKEN " ]]; then
16
13
echo CODECOV_TOKEN undefined
Original file line number Diff line number Diff line change @@ -10,5 +10,6 @@ rustup component add rustfmt-preview
10
10
cargo build --verbose --features unstable
11
11
cargo test --verbose --features unstable
12
12
cargo bench --verbose --features unstable
13
+ ci/coverage.sh
13
14
14
15
exit 0
You can’t perform that action at this time.
0 commit comments