]> git.lizzy.rs Git - rust.git/blob - ci/base-tests.sh
Let travis run cargo fmt --all -- --check
[rust.git] / ci / base-tests.sh
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.
4 #
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.
10
11
12 set -ex
13
14 echo "Running clippy base tests"
15
16 PATH=$PATH:./node_modules/.bin
17 if [ "$TRAVIS_OS_NAME" == "linux" ]; then
18   remark -f *.md > /dev/null
19 fi
20 # build clippy in debug mode and run tests
21 cargo build --features debugging
22 cargo test --features debugging
23 cd clippy_lints && cargo test && cd ..
24 cd rustc_tools_util && cargo test && cd ..
25 cd clippy_dev && cargo test && cd ..
26
27 # Perform various checks for lint registration
28 ./util/dev update_lints --check
29 cargo +nightly fmt --all -- --check
30
31 CLIPPY="`pwd`/target/debug/cargo-clippy clippy"
32 # run clippy on its own codebase...
33 ${CLIPPY} --all-targets --all-features -- -D clippy::all -D clippy::internal -Dclippy::pedantic
34 # ... and some test directories
35 for dir in clippy_workspace_tests clippy_workspace_tests/src clippy_workspace_tests/subcrate clippy_workspace_tests/subcrate/src clippy_dev rustc_tools_util
36 do
37     cd ${dir}
38     ${CLIPPY} -- -D clippy::all -D clippy::pedantic
39     cd -
40 done
41
42
43 # test --manifest-path
44 ${CLIPPY} --manifest-path=clippy_workspace_tests/Cargo.toml -- -D clippy::all
45 cd clippy_workspace_tests/subcrate && ${CLIPPY} --manifest-path=../Cargo.toml -- -D clippy::all && cd ../..
46 set +x