Skip to content

Commit 6ce656f

Browse files
committed
Auto merge of #11039 - Alexendoo:bless, r=llogiq
Add `BLESS` for compile-test and some cleanup changelog: none Allows passing the environment variable `BLESS` to bless tests, which is useful when you want to bless internal tests - `BLESS= cargo uitest -Finternal` Also updates a place in the docs referring to `cargo dev bless` and removes some unused test deps
2 parents 2e32905 + 76de556 commit 6ce656f

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

book/src/development/adding_lints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ fn is_foo_fn(fn_kind: FnKind<'_>) -> bool {
414414

415415
Now we should also run the full test suite with `cargo test`. At this point
416416
running `cargo test` should produce the expected output. Remember to run `cargo
417-
dev bless` to update the `.stderr` file.
417+
bless` to update the `.stderr` file.
418418

419419
`cargo test` (as opposed to `cargo uitest`) will also ensure that our lint
420420
implementation is not violating any Clippy lints itself.

clippy_test_deps/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
clap = { version = "4.1.4", features = ["derive"] }
109
clippy_utils = { path = "../clippy_utils" }
1110
derive-new = "0.5"
1211
if_chain = "1.0"
@@ -17,7 +16,6 @@ syn = { version = "2.0", features = ["full"] }
1716
futures = "0.3"
1817
parking_lot = "0.12"
1918
tokio = { version = "1", features = ["io-util"] }
20-
rustc-semver = "1.1"
2119
regex = "1.5"
2220
clippy_lints = { path = "../clippy_lints" }
2321

tests/compile-test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn base_config(test_dir: &str) -> compiletest::Config {
2424
mode: TestMode::Yolo,
2525
stderr_filters: vec![],
2626
stdout_filters: vec![],
27-
output_conflict_handling: if std::env::args().any(|arg| arg == "--bless") {
27+
output_conflict_handling: if var_os("BLESS").is_some() || env::args().any(|arg| arg == "--bless") {
2828
compiletest::OutputConflictHandling::Bless
2929
} else {
3030
compiletest::OutputConflictHandling::Error("cargo test -- -- --bless".into())
@@ -304,7 +304,6 @@ fn rustfix_coverage_known_exceptions_accuracy() {
304304
let rs_path = Path::new("tests/ui").join(filename);
305305
assert!(rs_path.exists(), "`{}` does not exist", rs_path.display());
306306
let fixed_path = rs_path.with_extension("fixed");
307-
println!("{}", fixed_path.display());
308307
assert!(!fixed_path.exists(), "`{}` exists", fixed_path.display());
309308
}
310309
}

0 commit comments

Comments
 (0)