]> git.lizzy.rs Git - rust.git/blob - ci/base-tests.sh
Auto merge of #3546 - matthiaskrgr:fix_install, r=oli-obk
[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 # 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 ..
28
29 # make sure clippy can be called via ./path/to/cargo-clippy
30 cd clippy_workspace_tests
31 ../target/debug/cargo-clippy
32 cd ..
33
34 # Perform various checks for lint registration
35 ./util/dev update_lints --check
36 cargo +nightly fmt --all -- --check
37
38
39 #avoid loop spam
40 set +x
41 # make sure tests are formatted
42
43 # some lints are sensitive to formatting, exclude some files
44 needs_formatting=false
45 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
46 rustfmt ${file} --check  || echo "${file} needs reformatting!" ; needs_formatting=true
47 done
48
49 if [ "${needs_reformatting}" = true ] ; then
50     echo "Tests need reformatting!"
51     exit 2
52 fi
53 set -x