From 6df1b4631323d821b59d3c371a4dd863b318e714 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Mon, 24 Jul 2023 15:35:43 -0400 Subject: [PATCH] Don't use dbg for printing stdout/stderr They are byte buffers, not strings. A pretty print has been added accordingly. --- tests/docker/src/lib.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/docker/src/lib.rs b/tests/docker/src/lib.rs index a4c29bbd..efb81b67 100644 --- a/tests/docker/src/lib.rs +++ b/tests/docker/src/lib.rs @@ -125,8 +125,19 @@ pub fn build(name: String) { .output() .unwrap(); if !res.status.success() { - dbg!(res.stdout); - dbg!(res.stderr); + println!("failed to build {name}\n"); + println!("-- stdout --"); + println!( + "{}\r\n", + String::from_utf8(res.stdout) + .unwrap_or_else(|_| "stdout had non-utf8 characters".to_string()) + ); + println!("-- stderr --"); + println!( + "{}\r\n", + String::from_utf8(res.stderr) + .unwrap_or_else(|_| "stderr had non-utf8 characters".to_string()) + ); panic!("failed to build {name}"); }