From 6ca6be6f2bfe063def8900a42c2f734be796a8c9 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Mon, 3 Jul 2023 13:40:14 -0400 Subject: [PATCH] Unite bless environment variables under `RUSTC_BLESS` Currently, Clippy, Miri, Rustfmt, and rustc all use an environment variable to indicate that output should be blessed, but they use different variable names. In order to improve consistency, this patch applies the following changes: - Emit `RUSTC_BLESS` within `prepare_cargo_test` so it is always available - Change usage of `MIRI_BLESS` in the Miri subtree to use `RUSTC_BLESS` - Change usage of `BLESS` in the Clippy subtree to `RUSTC_BLESS` - Change usage of `BLESS` in the Rustfmt subtree to `RUSTC_BLESS` - Adjust the blessable test in `rustc_errors` to use this same convention - Update documentation where applicable Any tools that uses `RUSTC_BLESS` should check that it is set to any value other than `"0"`. --- tests/compile-test.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/compile-test.rs b/tests/compile-test.rs index d70c4ea34cbcd..f714b2962331d 100644 --- a/tests/compile-test.rs +++ b/tests/compile-test.rs @@ -115,7 +115,9 @@ fn base_config(test_dir: &str) -> compiletest::Config { mode: TestMode::Yolo, stderr_filters: vec![], stdout_filters: vec![], - output_conflict_handling: if var_os("BLESS").is_some() || env::args().any(|arg| arg == "--bless") { + // FIXME(tgross35): deduplicate bless env once clippy can update + output_conflict_handling: if var_os("RUSTC_BLESS").is_some_and(|v| v != "0") + || env::args().any(|arg| arg == "--bless") { compiletest::OutputConflictHandling::Bless } else { compiletest::OutputConflictHandling::Error("cargo test -- -- --bless".into())