diff options
| author | Trevor Gross <tmgross@umich.edu> | 2023-07-03 13:40:14 -0400 |
|---|---|---|
| committer | Trevor Gross <tmgross@umich.edu> | 2023-07-26 16:54:02 -0400 |
| commit | 6ca6be6f2bfe063def8900a42c2f734be796a8c9 (patch) | |
| tree | 837d1f576a1123200014f687c64b1742af3d7be8 | |
| parent | ed2ec819e9d04b56c8cbb1b5f18119bb8292e542 (diff) | |
| download | rust-6ca6be6f2bfe063def8900a42c2f734be796a8c9.tar.gz rust-6ca6be6f2bfe063def8900a42c2f734be796a8c9.zip | |
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"`.
| -rw-r--r-- | tests/compile-test.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/compile-test.rs b/tests/compile-test.rs index d70c4ea34cb..f714b296233 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()) |
