mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Merge pull request #1919 from rust-lang-nursery/ui
Move all our tests back to ui tests
This commit is contained in:
commit
49b00ec440
1
.gitignore
vendored
1
.gitignore
vendored
@ -15,7 +15,6 @@ out
|
||||
# Generated by Cargo
|
||||
/target/
|
||||
/clippy_lints/target/
|
||||
/clippy_tests/target/
|
||||
|
||||
# We don't pin yet
|
||||
Cargo.lock
|
||||
|
@ -11,7 +11,7 @@ sudo: false
|
||||
cache:
|
||||
cargo: true
|
||||
directories:
|
||||
- clippy_tests/target
|
||||
- target
|
||||
|
||||
env:
|
||||
global:
|
||||
@ -32,7 +32,7 @@ script:
|
||||
- cargo build --features debugging
|
||||
- cargo test --features debugging
|
||||
- mkdir -p ~/rust/cargo/bin
|
||||
- cp clippy_tests/target/debug/cargo-clippy ~/rust/cargo/bin/cargo-clippy
|
||||
- cp target/debug/cargo-clippy ~/rust/cargo/bin/cargo-clippy
|
||||
- PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy
|
||||
- cd clippy_lints && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ..
|
||||
- cd clippy_workspace_tests && PATH=$PATH:~/rust/cargo/bin cargo clippy -- -D clippy && cd ..
|
||||
|
@ -39,15 +39,10 @@ Compiling clippy can take almost a minute or more depending on your machine.
|
||||
You can set the environment flag `CARGO_INCREMENTAL=1` to cut down that time to
|
||||
almost a third on average, depending on the influence your change has.
|
||||
|
||||
Clippy uses its own version of UI tests. Run `cargo test examples` to run only the ui tests.
|
||||
This will update all the `*.stderr` files in `clippy_tests/examples`. You need to check
|
||||
the stderr files whether they look as you expected them and commit them together with your
|
||||
changes.
|
||||
When you want to test a new lint, just create a new file in `clippy_tests/examples` and
|
||||
rerun `cargo test examples`.
|
||||
|
||||
You can check just one example by running `cargo run --example example_name` inside the
|
||||
`clippy_tests` directory.
|
||||
Clippy uses UI tests. UI tests check that the output of the compiler is exactly as expected.
|
||||
Of course there's little sense in writing the output yourself or copying it around.
|
||||
Therefore you can simply run `tests/ui/update-all-references.sh` and check whether
|
||||
the output looks as you expect with `git diff`. Commit all `*.stderr` files, too.
|
||||
|
||||
Also please document your lint with a doc comment akin to the following:
|
||||
```rust
|
||||
|
@ -14,7 +14,6 @@ readme = "README.md"
|
||||
license = "MPL-2.0"
|
||||
keywords = ["clippy", "lint", "plugin"]
|
||||
categories = ["development-tools", "development-tools::cargo-plugins"]
|
||||
workspace = "clippy_tests"
|
||||
|
||||
[badges]
|
||||
travis-ci = { repository = "Manishearth/rust-clippy" }
|
||||
@ -47,3 +46,5 @@ serde = "1.0"
|
||||
|
||||
[features]
|
||||
debugging = []
|
||||
|
||||
[workspace]
|
||||
|
@ -26,7 +26,7 @@ test_script:
|
||||
- set RUST_BACKTRACE=1
|
||||
- cargo build --features debugging
|
||||
- cargo test --features debugging
|
||||
- copy clippy_tests\target\debug\cargo-clippy.exe C:\Users\appveyor\.cargo\bin\
|
||||
- copy target\debug\cargo-clippy.exe C:\Users\appveyor\.cargo\bin\
|
||||
- cargo clippy -- -D clippy
|
||||
- cd clippy_lints && cargo clippy -- -D clippy && cd ..
|
||||
|
||||
|
@ -14,7 +14,7 @@ repository = "https://github.com/Manishearth/rust-clippy"
|
||||
readme = "README.md"
|
||||
license = "MPL-2.0"
|
||||
keywords = ["clippy", "lint", "plugin"]
|
||||
workspace = "../clippy_tests"
|
||||
workspace = ".."
|
||||
|
||||
[dependencies]
|
||||
itertools = "0.6.0"
|
||||
|
@ -1,9 +0,0 @@
|
||||
[package]
|
||||
name = "clippy_tests"
|
||||
version = "0.1.0"
|
||||
authors = ["Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>"]
|
||||
|
||||
[dependencies]
|
||||
clippy = { path = ".." }
|
||||
|
||||
[workspace]
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user