]> git.lizzy.rs Git - rust.git/blob - ci/base-tests.sh
Travis: Add rustc sysroot bin to PATH for windows build
[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 # Add bin to PATH for windows
32 PATH=$PATH:$(rustc --print sysroot)/bin
33
34 CLIPPY="`pwd`/target/debug/cargo-clippy clippy"
35 # run clippy on its own codebase...
36 ${CLIPPY} --all-targets --all-features -- -D clippy::all -D clippy::internal -Dclippy::pedantic
37 # ... and some test directories
38 for dir in clippy_workspace_tests clippy_workspace_tests/src clippy_workspace_tests/subcrate clippy_workspace_tests/subcrate/src clippy_dev rustc_tools_util
39 do
40     cd ${dir}
41     ${CLIPPY} -- -D clippy::all -D clippy::pedantic
42     cd -
43 done
44
45
46 # test --manifest-path
47 ${CLIPPY} --manifest-path=clippy_workspace_tests/Cargo.toml -- -D clippy::all
48 cd clippy_workspace_tests/subcrate && ${CLIPPY} --manifest-path=../Cargo.toml -- -D clippy::all && cd ../..
49 set +x