-
Notifications
You must be signed in to change notification settings - Fork 8
/
cov.sh
executable file
·42 lines (41 loc) · 1.24 KB
/
cov.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
RUSTFLAGS="-Z instrument-coverage" LLVM_PROFILE_FILE="minivec-%m.profraw" \
cargo test --tests \
&& cargo profdata -- merge -sparse minivec-*.profraw -o minivec.profdata \
&& cargo cov -- report \
$( \
for file in \
$( \
RUSTFLAGS="-Z instrument-coverage" \
cargo test --tests --no-run --message-format=json \
| jq -r "select(.profile.test == true) | .filenames[]" \
| grep -v dSYM - \
); \
do \
printf "%s %s " -object $file; \
done \
) \
--use-color \
--ignore-filename-regex='/.cargo/registry' \
--instr-profile=minivec.profdata \
--summary-only \
&& cargo cov -- show \
$( \
for file in \
$( \
RUSTFLAGS="-Z instrument-coverage" \
cargo test --tests --no-run --message-format=json \
| jq -r "select(.profile.test == true) | .filenames[]" \
| grep -v dSYM - \
); \
do \
printf "%s %s " -object $file; \
done \
) \
--use-color \
--ignore-filename-regex='/.cargo/registry' \
--instr-profile=minivec.profdata \
--show-instantiations \
--show-line-counts-or-regions \
--Xdemangler=rustfilt \
--format=html > minivec-coverage.html