mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 12:39:31 +03:00
Add cargo-clippy sysroot test
Whne SYSROOT is defined, clippy-driver will insert a --sysroot argument when calling rustc. However, when a sysroot argument is already defined, e.g. through RUSTFLAGS=--sysroot=... the `cargo clippy` call would error. This tests that the sysroot argument is only passed once and that SYSROOT is ignored in this case.
This commit is contained in:
@@ -17,6 +17,13 @@ test "$sysroot" = $desired_sysroot
|
||||
sysroot=$(SYSROOT=$desired_sysroot ./target/debug/clippy-driver --print sysroot)
|
||||
test "$sysroot" = $desired_sysroot
|
||||
|
||||
# Check that the --sysroot argument is only passed once (SYSROOT is ignored)
|
||||
(
|
||||
cd rustc_tools_util
|
||||
touch src/lib.rs
|
||||
SYSROOT=/tmp RUSTFLAGS="--sysroot=$(rustc --print sysroot)" ../target/debug/cargo-clippy clippy --verbose
|
||||
)
|
||||
|
||||
# Make sure this isn't set - clippy-driver should cope without it
|
||||
unset CARGO_MANIFEST_DIR
|
||||
|
||||
|
||||
Reference in New Issue
Block a user