Skip to content

Commit 2cd58e4

Browse files
committed
Improve the coverage script
1 parent 12c2d6a commit 2cd58e4

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

util/cov.sh

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,32 @@
55
# `compile-test` is special. `kcov` does not work directly on it so these files
66
# are compiled manually.
77

8-
tests=(
9-
camel_case
10-
cc_seme
11-
consts
12-
dogfood
13-
issue_825
14-
matches
15-
trim_multiline
16-
used_underscore_binding_macro
17-
versioncheck
18-
)
8+
tests=$(find tests/ -maxdepth 1 -name '*.rs' ! -name compile-test.rs -exec basename {} .rs \;)
199
tmpdir=$(mktemp -d)
2010

2111
cargo test --no-run --verbose
2212

23-
for t in "${tests[@]}"; do
13+
for t in $tests; do
2414
kcov \
2515
--verify \
26-
--include-path="$(pwd)/src","$(pwd)/clippy_lints/src" \
16+
--include-path="$(pwd)/src,$(pwd)/clippy_lints/src" \
2717
"$tmpdir/$t" \
2818
cargo test --test "$t"
2919
done
3020

3121
for t in ./tests/compile-fail/*.rs; do
3222
kcov \
3323
--verify \
34-
--include-path="$(pwd)/src","$(pwd)/clippy_lints/src" \
35-
"$tmpdir/compile-fail-$(basename $t)" \
24+
--include-path="$(pwd)/src,$(pwd)/clippy_lints/src" \
25+
"$tmpdir/compile-fail-$(basename "$t")" \
3626
cargo run -- -L target/debug -L target/debug/deps -Z no-trans "$t"
3727
done
3828

3929
for t in ./tests/run-pass/*.rs; do
4030
kcov \
4131
--verify \
42-
--include-path="$(pwd)/src","$(pwd)/clippy_lints/src" \
43-
"$tmpdir/run-pass-$(basename $t)" \
32+
--include-path="$(pwd)/src,$(pwd)/clippy_lints/src" \
33+
"$tmpdir/run-pass-$(basename "$t")" \
4434
cargo run -- -L target/debug -L target/debug/deps -Z no-trans "$t"
4535
done
4636

0 commit comments

Comments
 (0)