1 # Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
14 echo "Running clippy base tests"
16 PATH=$PATH:./node_modules/.bin
17 if [ "$TRAVIS_OS_NAME" == "linux" ]; then
18 remark -f *.md > /dev/null
20 # build clippy in debug mode and run tests
21 cargo build --features debugging
22 cargo test --features debugging
23 # for faster build, share target dir between subcrates
24 export CARGO_TARGET_DIR=`pwd`/target/
25 cd clippy_lints && cargo test && cd ..
26 cd rustc_tools_util && cargo test && cd ..
27 cd clippy_dev && cargo test && cd ..
29 # make sure clippy can be called via ./path/to/cargo-clippy
30 cd clippy_workspace_tests
31 ../target/debug/cargo-clippy
34 # Perform various checks for lint registration
35 ./util/dev update_lints --check
36 cargo +nightly fmt --all -- --check
38 # make sure tests are formatted
40 # some lints are sensitive to formatting, exclude some files
41 tests_need_reformatting="false"
43 rustup default nightly
44 # avoid loop spam and allow cmds with exit status != 0
47 for file in `find tests -not -path "tests/ui/methods.rs" -not -path "tests/ui/format.rs" -not -path "tests/ui/formatting.rs" -not -path "tests/ui/empty_line_after_outer_attribute.rs" -not -path "tests/ui/double_parens.rs" -not -path "tests/ui/doc.rs" -not -path "tests/ui/unused_unit.rs" | grep "\.rs$"` ; do
48 rustfmt ${file} --check
50 echo "${file} needs reformatting!"
51 tests_need_reformatting="true"
57 if [ "${tests_need_reformatting}" == "true" ] ; then
58 echo "Tests need reformatting!"
62 # switch back to master