diff --git a/tests/tests.rs b/tests/tests.rs index 41162237..97bdf21f 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -186,7 +186,21 @@ fn compile( println!("Running: {:?}", command); let out = command.output().expect("failed to compile"); - assert!(out.status.success(), "Output failed to compile: {:?}", out); + if !out.status.success() { + let stdout = match str::from_utf8(&out.stdout) { + Ok(s) => s.to_string(), + Err(_) => format!("{:?}", out.stdout), + }; + let stderr = match str::from_utf8(&out.stderr) { + Ok(s) => s.to_string(), + Err(_) => format!("{:?}", out.stderr), + }; + println!("Output failed to compile: {:?}", out.status); + println!("=== STDOUT ===\n{}", stdout); + println!("=== STDERR ===\n{}", stderr); + println!("=============="); + assert!(out.status.success()); + } if object.exists() { fs::remove_file(object).unwrap();