Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #126434

Closed
wants to merge 27 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bd6fca2
Clarify `Command::new` behavior if passed programs with arguments
jieyouxu Apr 10, 2024
523408e
Fix wording in {checked_}next_power_of_two
Kriskras99 Jun 13, 2024
10c7643
Small style improvement in `gvn.rs`
WaffleLapkin Jun 13, 2024
9314831
Implement `CompletedProcess::assert_stdout_contains` and improve erro…
GuillaumeGomez Jun 13, 2024
96f9fe5
Migrate `run-make/allow-non-lint-warnings-cmdline` to `rmake.rs`
GuillaumeGomez Jun 13, 2024
eca8d20
Make `run-make/allow-non-lint-warnings-cmdline` into a ui test
GuillaumeGomez Jun 13, 2024
9bff230
Allow to bless diff tests
GuillaumeGomez Jun 11, 2024
be7b587
Migrate `run-make/const_fn_mir` to `rmake.rs`
GuillaumeGomez Jun 11, 2024
0cc099b
fix wrong assert_unsafe_precondition message for core::ptr::copy
firefighterduck Jun 13, 2024
5f4111f
Update run-make-support/diff to new `fs_wrapper` API
GuillaumeGomez Jun 13, 2024
d3812ac
LangItem-ify Coroutine trait in solvers
compiler-errors Jun 12, 2024
b79360a
Rework most of structural_traits to be Interner-agnostic
compiler-errors May 30, 2024
e82db89
Finish uplifting all of structural_traits
compiler-errors Jun 12, 2024
a2fb2eb
Fix some TODOs
compiler-errors Jun 12, 2024
c8e4206
Address nits
compiler-errors Jun 13, 2024
a1667a9
Fix Miri sysroot for `x run`
Noratrieb Jun 10, 2024
b316033
rename CompileTimeInterpreter -> CompileTimeMachine, CompileTimeEvalC…
RalfJung Jun 13, 2024
54e24c1
const-eval: make lint scope computation consistent
RalfJung Jun 13, 2024
b5d9eb0
Rollup merge of #123726 - jieyouxu:command-new-docs, r=Nilstrieb
matthiaskrgr Jun 13, 2024
016fc2e
Rollup merge of #126238 - Nilstrieb:run,miri,run, r=RalfJung
matthiaskrgr Jun 13, 2024
a088b45
Rollup merge of #126270 - GuillaumeGomez:migrate-run-make-const_fn_mi…
matthiaskrgr Jun 13, 2024
45ee933
Rollup merge of #126360 - compiler-errors:uplift-structural-traits, r…
matthiaskrgr Jun 13, 2024
65a9cd0
Rollup merge of #126386 - GuillaumeGomez:migrate-run-make-allow-non-l…
matthiaskrgr Jun 13, 2024
16a6dac
Rollup merge of #126388 - RalfJung:const-eval-lint-scope, r=oli-obk
matthiaskrgr Jun 13, 2024
332d7d2
Rollup merge of #126390 - Kriskras99:master, r=Nilstrieb
matthiaskrgr Jun 13, 2024
a67979b
Rollup merge of #126392 - WaffleLapkin:gvn-style-ish-changes, r=scottmcm
matthiaskrgr Jun 13, 2024
650935e
Rollup merge of #126402 - firefighterduck:fix-unsafe-precon-copy, r=N…
matthiaskrgr Jun 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Allow to bless diff tests
GuillaumeGomez committed Jun 13, 2024

Verified

This commit was signed with the committer’s verified signature.
CraftSpider Rune Tynan
commit 9bff23005dc8cfca8fab4e5edaaf7d910b6c10f3
14 changes: 13 additions & 1 deletion src/tools/run-make-support/src/diff/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use regex::Regex;
use similar::TextDiff;
use std::path::Path;
use std::path::{Path, PathBuf};

use crate::drop_bomb::DropBomb;

@@ -17,6 +17,7 @@ pub fn diff() -> Diff {
pub struct Diff {
expected: Option<String>,
expected_name: Option<String>,
expected_file: Option<PathBuf>,
actual: Option<String>,
actual_name: Option<String>,
normalizers: Vec<(String, String)>,
@@ -30,6 +31,7 @@ impl Diff {
Self {
expected: None,
expected_name: None,
expected_file: None,
actual: None,
actual_name: None,
normalizers: Vec::new(),
@@ -43,6 +45,7 @@ impl Diff {
let content = std::fs::read_to_string(path).expect("failed to read file");
let name = path.to_string_lossy().to_string();

self.expected_file = Some(path.into());
self.expected = Some(content);
self.expected_name = Some(name);
self
@@ -104,6 +107,15 @@ impl Diff {
.to_string();

if !output.is_empty() {
// If we can bless (meaning we have a file to write into and the `RUSTC_BLESS_TEST`
// environment variable set), then we write into the file and return.
if let Some(ref expected_file) = self.expected_file {
if std::env::var("RUSTC_BLESS_TEST").is_ok() {
println!("Blessing `{}`", expected_file.display());
std::fs::write(expected_file, actual).unwrap();
return;
}
}
panic!(
"test failed: `{}` is different from `{}`\n\n{}",
expected_name, actual_name, output