3 # Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
4 # file at the top-level directory of this distribution and at
5 # http://rust-lang.org/COPYRIGHT.
7 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10 # option. This file may not be copied, modified, or distributed
11 # except according to those terms.
14 # This run `kcov` on Clippy. The coverage report will be at
15 # `./target/cov/index.html`.
16 # `compile-test` is special. `kcov` does not work directly on it so these files
17 # are compiled manually.
19 tests=$(find tests/ -maxdepth 1 -name '*.rs' ! -name compile-test.rs -exec basename {} .rs \;)
22 cargo test --no-run --verbose
27 --include-path="$(pwd)/src,$(pwd)/clippy_lints/src" \
29 cargo test --test "$t"
32 for t in ./tests/compile-fail/*.rs; do
35 --include-path="$(pwd)/src,$(pwd)/clippy_lints/src" \
36 "$tmpdir/compile-fail-$(basename "$t")" \
37 cargo run -- -L target/debug -L target/debug/deps -Z no-trans "$t"
40 for t in ./tests/run-pass/*.rs; do
43 --include-path="$(pwd)/src,$(pwd)/clippy_lints/src" \
44 "$tmpdir/run-pass-$(basename "$t")" \
45 cargo run -- -L target/debug -L target/debug/deps -Z no-trans "$t"
48 kcov --verify --merge target/cov "$tmpdir"/*