Skip to content

Commit

Permalink
Add more test
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinh Tran committed Jan 26, 2024
1 parent aa3490a commit bccb2eb
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,16 @@ if [[ ${OS} == "Windows" ]]; then
else
desired_sysroot=/tmp
fi
# Set --sysroot in command line
sysroot=$(./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot)
test "$sysroot" = $desired_sysroot

# Set --sysroot in arg_file.txt and pass @arg_file.txt to command line
echo "--sysroot=$desired_sysroot" > arg_file.txt
sysroot=$(./target/debug/clippy-driver @arg_file.txt --print sysroot)
test "$sysroot" = $desired_sysroot

# Setting SYSROOT in command line
sysroot=$(SYSROOT=$desired_sysroot ./target/debug/clippy-driver --print sysroot)
test "$sysroot" = $desired_sysroot

Expand Down
2 changes: 2 additions & 0 deletions arg_file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--sysroot=/usr/local/google/home/vinhdaitran/.rustup/toolchains/nightly-2024-01-11-x86_64-unknown-linux-gnu
--verbose
12 changes: 12 additions & 0 deletions double_neg.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error: `--x` could be misinterpreted as pre-decrement by C programmers, is usually a no-op
--> tests/ui/double_neg.rs:7:5
|
LL | --x;
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_neg
= note: `-D clippy::double-neg` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::double_neg)]`

error: aborting due to 1 previous error

Binary file added driver_test
Binary file not shown.
11 changes: 11 additions & 0 deletions normalized.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error: `--x` could be misinterpreted as pre-decrement by C programmers, is usually a no-op
--> $DIR/double_neg.rs:7:5
|
LL | --x;
| ^^^
|
= note: `-D clippy::double-neg` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::double_neg)]`

error: aborting due to 1 previous error

0 comments on commit bccb2eb

Please sign in to comment.