Skip to content

Commit 43572a3

Browse files
committed
Port clippy away from compiletest to ui_test
1 parent 113c704 commit 43572a3

File tree

10 files changed

+1050
-322
lines changed

10 files changed

+1050
-322
lines changed

Cargo.toml

+6-15
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,20 @@ tempfile = { version = "3.2", optional = true }
2828
termize = "0.1"
2929

3030
[dev-dependencies]
31-
compiletest_rs = { version = "0.9", features = ["tmp"] }
31+
ui_test = { git = "https://github.com/oli-obk/ui_test.git", branch = "aux_build" }
3232
tester = "0.9"
3333
regex = "1.5"
3434
toml = "0.5"
3535
walkdir = "2.3"
3636
# This is used by the `collect-metadata` alias.
3737
filetime = "0.2"
38+
itertools = "0.10.1"
3839

3940
# A noop dependency that changes in the Rust repository, it's a bit of a hack.
4041
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
4142
# for more information.
4243
rustc-workspace-hack = "1.0"
4344

44-
# UI test dependencies
45-
clap = { version = "4.1.4", features = ["derive"] }
46-
clippy_utils = { path = "clippy_utils" }
47-
derive-new = "0.5"
48-
if_chain = "1.0"
49-
itertools = "0.10.1"
50-
quote = "1.0"
51-
serde = { version = "1.0.125", features = ["derive"] }
52-
syn = { version = "1.0", features = ["full"] }
53-
futures = "0.3"
54-
parking_lot = "0.12"
55-
tokio = { version = "1", features = ["io-util"] }
56-
rustc-semver = "1.1"
57-
5845
[build-dependencies]
5946
rustc_tools_util = "0.3.0"
6047

@@ -66,3 +53,7 @@ internal = ["clippy_lints/internal", "tempfile"]
6653
[package.metadata.rust-analyzer]
6754
# This package uses #[feature(rustc_private)]
6855
rustc_private = true
56+
57+
[[test]]
58+
name = "compile-test"
59+
harness = false

book/src/development/adding_lints.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ The process of generating the `.stderr` file is the same, and prepending the
163163
## Rustfix tests
164164

165165
If the lint you are working on is making use of structured suggestions, the test
166-
file should include a `// run-rustfix` comment at the top. This will
166+
file should include a `//@run-rustfix` comment at the top. This will
167167
additionally run [rustfix] for that test. Rustfix will apply the suggestions
168168
from the lint to the code of the test file and compare that to the contents of a
169169
`.fixed` file.

clippy_dev/src/new_lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn create_test(lint: &LintData<'_>) -> io::Result<()> {
8787

8888
path.push("src");
8989
fs::create_dir(&path)?;
90-
let header = format!("// compile-flags: --crate-name={lint_name}");
90+
let header = format!("//@compile-flags: --crate-name={lint_name}");
9191
write_file(path.join("main.rs"), get_test_file_contents(lint_name, Some(&header)))?;
9292

9393
Ok(())

clippy_dev/src/update_lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ fn gen_deprecated_lints_test(lints: &[DeprecatedLint]) -> String {
745745
fn gen_renamed_lints_test(lints: &[RenamedLint]) -> String {
746746
let mut seen_lints = HashSet::new();
747747
let mut res: String = GENERATED_FILE_COMMENT.into();
748-
res.push_str("// run-rustfix\n\n");
748+
res.push_str("//@run-rustfix\n\n");
749749
for lint in lints {
750750
if seen_lints.insert(&lint.new_name) {
751751
writeln!(res, "#![allow({})]", lint.new_name).unwrap();

0 commit comments

Comments
 (0)