Skip to content

Commit

Permalink
Unite bless environment variables under RUSTC_BLESS
Browse files Browse the repository at this point in the history
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"`.
  • Loading branch information
tgross35 committed Jul 26, 2023
1 parent ed2ec81 commit 6ca6be6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/compile-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 6ca6be6

Please sign in to comment.