2018-05-16 11:55:21 -05:00
|
|
|
set -ex
|
2018-07-28 05:14:35 -05:00
|
|
|
|
|
|
|
echo "Running clippy base tests"
|
|
|
|
|
2018-05-16 02:10:35 -05:00
|
|
|
PATH=$PATH:./node_modules/.bin
|
2018-10-12 00:59:08 -05:00
|
|
|
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
2019-03-01 00:32:51 -06:00
|
|
|
remark -f *.md -f doc/*.md > /dev/null
|
2018-10-12 00:59:08 -05:00
|
|
|
fi
|
2018-07-28 05:14:35 -05:00
|
|
|
# build clippy in debug mode and run tests
|
2019-07-15 00:35:02 -05:00
|
|
|
cargo build --features "debugging deny-warnings"
|
|
|
|
cargo test --features "debugging deny-warnings"
|
2018-12-09 15:47:22 -06:00
|
|
|
# for faster build, share target dir between subcrates
|
|
|
|
export CARGO_TARGET_DIR=`pwd`/target/
|
2019-01-26 19:49:29 -06:00
|
|
|
(cd clippy_lints && cargo test)
|
|
|
|
(cd rustc_tools_util && cargo test)
|
|
|
|
(cd clippy_dev && cargo test)
|
2018-11-04 02:41:28 -06:00
|
|
|
|
2018-12-14 14:43:40 -06:00
|
|
|
# make sure clippy can be called via ./path/to/cargo-clippy
|
2019-01-26 19:49:29 -06:00
|
|
|
(
|
|
|
|
cd clippy_workspace_tests
|
|
|
|
../target/debug/cargo-clippy
|
|
|
|
)
|
2018-12-14 14:43:40 -06:00
|
|
|
|
2018-11-04 02:41:28 -06:00
|
|
|
# Perform various checks for lint registration
|
|
|
|
./util/dev update_lints --check
|
2019-05-16 00:31:56 -05:00
|
|
|
./util/dev --limit-stderr-length
|
2018-12-09 15:06:29 -06:00
|
|
|
|
2019-01-26 20:24:45 -06:00
|
|
|
# Check running clippy-driver without cargo
|
|
|
|
(
|
|
|
|
# Check sysroot handling
|
|
|
|
sysroot=$(./target/debug/clippy-driver --print sysroot)
|
|
|
|
test $sysroot = $(rustc --print sysroot)
|
|
|
|
|
2019-07-13 04:42:44 -05:00
|
|
|
if [ -z $OS_WINDOWS ]; then
|
|
|
|
desired_sysroot=/tmp
|
|
|
|
else
|
|
|
|
desired_sysroot=C:/tmp
|
|
|
|
fi
|
|
|
|
sysroot=$(./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot)
|
|
|
|
test $sysroot = $desired_sysroot
|
|
|
|
|
|
|
|
sysroot=$(SYSROOT=$desired_sysroot ./target/debug/clippy-driver --print sysroot)
|
|
|
|
test $sysroot = $desired_sysroot
|
2019-01-26 20:24:45 -06:00
|
|
|
|
|
|
|
# Make sure this isn't set - clippy-driver should cope without it
|
|
|
|
unset CARGO_MANIFEST_DIR
|
|
|
|
|
|
|
|
# Run a lint and make sure it produces the expected output. It's also expected to exit with code 1
|
|
|
|
# XXX How to match the clippy invocation in compile-test.rs?
|
|
|
|
! ./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/cstring.rs 2> cstring.stderr
|
|
|
|
diff <(sed -e 's,tests/ui,$DIR,' -e '/= help/d' cstring.stderr) tests/ui/cstring.stderr
|
|
|
|
|
|
|
|
# TODO: CLIPPY_CONF_DIR / CARGO_MANIFEST_DIR
|
|
|
|
)
|