about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2025-08-27 17:30:59 +1000
committerZalathar <Zalathar@users.noreply.github.com>2025-08-27 17:44:52 +1000
commit21de27c88a87a141003198ec0d9df789ca9c75cc (patch)
treea33cb77996e7e836bad75e03e0686c31f2568677 /src
parent269d5b56bcfdf2be82213e72ef9a2e4c592a8c6b (diff)
downloadrust-21de27c88a87a141003198ec0d9df789ca9c75cc.tar.gz
rust-21de27c88a87a141003198ec0d9df789ca9c75cc.zip
Explicitly mark the end of a failed test's captured output
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/src/utils/render_tests.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bootstrap/src/utils/render_tests.rs b/src/bootstrap/src/utils/render_tests.rs
index 40006aca5c5..90fd57d976d 100644
--- a/src/bootstrap/src/utils/render_tests.rs
+++ b/src/bootstrap/src/utils/render_tests.rs
@@ -250,8 +250,14 @@ impl<'a> Renderer<'a> {
                 if failure.stdout.is_some() || failure.message.is_some() {
                     println!("---- {} stdout ----", failure.name);
                     if let Some(stdout) = &failure.stdout {
-                        println!("{stdout}");
+                        // Captured test output normally ends with a newline,
+                        // so only use `println!` if it doesn't.
+                        print!("{stdout}");
+                        if !stdout.ends_with('\n') {
+                            println!("\n\\ (no newline at end of output)");
+                        }
                     }
+                    println!("---- {} stdout end ----", failure.name);
                     if let Some(message) = &failure.message {
                         println!("NOTE: {message}");
                     }