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 | 08fd1644d2a52d7e10aa648d5baee54034b715e9 (patch) | |
| tree | d9ea610952bf3a13708bfed7f9f23b281ff848a2 | |
| parent | c0ee8f5fea8d129516831523569fbe7424abdddc (diff) | |
| download | rust-08fd1644d2a52d7e10aa648d5baee54034b715e9.tar.gz rust-08fd1644d2a52d7e10aa648d5baee54034b715e9.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-- | src/test/mod.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/test/mod.rs b/src/test/mod.rs index 364aa225f68..37854ead28b 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -838,11 +838,9 @@ fn handle_result( // Ignore LF and CRLF difference for Windows. if !string_eq_ignore_newline_repr(&fmt_text, &text) { - if let Some(bless) = std::env::var_os("BLESS") { - if bless != "0" { - std::fs::write(file_name, fmt_text).unwrap(); - continue; - } + if std::env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0") { + std::fs::write(file_name, fmt_text).unwrap(); + continue; } let diff = make_diff(&text, &fmt_text, DIFF_CONTEXT_SIZE); assert!( |
