diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-05-14 18:43:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-14 18:43:38 +0200 |
| commit | 8e34100014bc595685d337c9d52a88ded39ff2fc (patch) | |
| tree | 9efdbd91c33312c341720e91a721e2bc547eedf3 /src | |
| parent | 0267905eeebd71901b7f43a683292b3e94eb14ba (diff) | |
| parent | 82fbbc0882e64847e60934dba64188c07207b345 (diff) | |
| download | rust-8e34100014bc595685d337c9d52a88ded39ff2fc.tar.gz rust-8e34100014bc595685d337c9d52a88ded39ff2fc.zip | |
Rollup merge of #140953 - jieyouxu:compiletest-bless-msg, r=compiler-errors
Fix a compiletest blessing message It was showing compare mode instead of test name. Fixes #140945. Noticed in https://github.com/rust-lang/rust/pull/140622#issuecomment-2868705612.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 3c87bcb205f..75f24adb70f 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2609,18 +2609,19 @@ impl<'test> TestCx<'test> { (expected, actual) }; - // Write the actual output to a file in build/ - let test_name = self.config.compare_mode.as_ref().map_or("", |m| m.to_str()); + // Write the actual output to a file in build directory. let actual_path = self .output_base_name() .with_extra_extension(self.revision.unwrap_or("")) - .with_extra_extension(test_name) + .with_extra_extension( + self.config.compare_mode.as_ref().map(|cm| cm.to_str()).unwrap_or(""), + ) .with_extra_extension(stream); if let Err(err) = fs::write(&actual_path, &actual) { - self.fatal(&format!("failed to write {stream} to `{actual_path:?}`: {err}",)); + self.fatal(&format!("failed to write {stream} to `{actual_path}`: {err}",)); } - println!("Saved the actual {stream} to {actual_path:?}"); + println!("Saved the actual {stream} to `{actual_path}`"); if !self.config.bless { if expected.is_empty() { @@ -2646,13 +2647,16 @@ impl<'test> TestCx<'test> { if !actual.is_empty() { if let Err(err) = fs::write(&expected_path, &actual) { - self.fatal(&format!("failed to write {stream} to `{expected_path:?}`: {err}")); + self.fatal(&format!("failed to write {stream} to `{expected_path}`: {err}")); } - println!("Blessing the {stream} of {test_name} in {expected_path:?}"); + println!( + "Blessing the {stream} of `{test_name}` as `{expected_path}`", + test_name = self.testpaths.file + ); } } - println!("\nThe actual {0} differed from the expected {0}.", stream); + println!("\nThe actual {stream} differed from the expected {stream}"); if self.config.bless { CompareOutcome::Blessed } else { CompareOutcome::Differed } } |
