1
+ #! /usr/bin/env bash
1
2
set -ex
2
3
3
4
echo " Running clippy base tests"
4
5
5
6
PATH=$PATH :./node_modules/.bin
6
7
if [ " $TRAVIS_OS_NAME " == " linux" ]; then
7
- remark -f * .md -f doc/* .md > /dev/null
8
+ remark -f ./ * .md -f doc/* .md > /dev/null
8
9
fi
9
10
# build clippy in debug mode and run tests
10
11
cargo build --features " debugging deny-warnings"
11
12
cargo test --features " debugging deny-warnings"
12
13
# for faster build, share target dir between subcrates
13
- export CARGO_TARGET_DIR=` pwd` /target/
14
+ CARGO_TARGET_DIR=$( pwd) /target/
15
+ export CARGO_TARGET_DIR
14
16
(cd clippy_lints && cargo test)
15
17
(cd rustc_tools_util && cargo test)
16
18
(cd clippy_dev && cargo test)
@@ -29,25 +31,25 @@ export CARGO_TARGET_DIR=`pwd`/target/
29
31
(
30
32
# Check sysroot handling
31
33
sysroot=$( ./target/debug/clippy-driver --print sysroot)
32
- test $sysroot = $( rustc --print sysroot)
34
+ test " $sysroot " = " $( rustc --print sysroot) "
33
35
34
- if [ -z $OS_WINDOWS ]; then
36
+ if [ -z " $OS_WINDOWS " ]; then
35
37
desired_sysroot=/tmp
36
38
else
37
39
desired_sysroot=C:/tmp
38
40
fi
39
41
sysroot=$( ./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot)
40
- test $sysroot = $desired_sysroot
42
+ test " $sysroot " = $desired_sysroot
41
43
42
44
sysroot=$( SYSROOT=$desired_sysroot ./target/debug/clippy-driver --print sysroot)
43
- test $sysroot = $desired_sysroot
45
+ test " $sysroot " = $desired_sysroot
44
46
45
47
# Make sure this isn't set - clippy-driver should cope without it
46
48
unset CARGO_MANIFEST_DIR
47
49
48
50
# Run a lint and make sure it produces the expected output. It's also expected to exit with code 1
49
51
# XXX How to match the clippy invocation in compile-test.rs?
50
- ! ./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/cstring.rs 2> cstring.stderr
52
+ ./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/cstring.rs 2> cstring.stderr && exit 1
51
53
diff <( sed -e ' s,tests/ui,$DIR,' -e ' /= help/d' cstring.stderr) tests/ui/cstring.stderr
52
54
53
55
# TODO: CLIPPY_CONF_DIR / CARGO_MANIFEST_DIR
0 commit comments