3 # This run `kcov` on Clippy. The coverage report will be at
4 # `./target/cov/index.html`.
5 # `compile-test` is special. `kcov` does not work directly on it so these files
6 # are compiled manually.
8 tests=$(find tests/ -maxdepth 1 -name '*.rs' ! -name compile-test.rs -exec basename {} .rs \;)
11 cargo test --no-run --verbose
16 --include-path="$(pwd)/src,$(pwd)/clippy_lints/src" \
18 cargo test --test "$t"
21 for t in ./tests/compile-fail/*.rs; do
24 --include-path="$(pwd)/src,$(pwd)/clippy_lints/src" \
25 "$tmpdir/compile-fail-$(basename "$t")" \
26 cargo run -- -L target/debug -L target/debug/deps -Z no-trans "$t"
29 for t in ./tests/run-pass/*.rs; do
32 --include-path="$(pwd)/src,$(pwd)/clippy_lints/src" \
33 "$tmpdir/run-pass-$(basename "$t")" \
34 cargo run -- -L target/debug -L target/debug/deps -Z no-trans "$t"
37 kcov --verify --merge target/cov "$tmpdir"/*