From a9b2a4aaf145a55c54642d4592d92c739e3a4b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 15 Jan 2020 23:34:30 -0700 Subject: Print stderr and stdout --- tests/cli.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/cli.rs') diff --git a/tests/cli.rs b/tests/cli.rs index 34f0ae7..2d32e4d 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -24,15 +24,20 @@ fn get_signal(_status: ExitStatus) -> Option { impl Success2 for Assert { fn success2(self) -> Self { if !self.get_output().status.success() { - let code = self.get_output().status.code(); + let output = self.get_output(); + let code = output.status.code(); + println!("status: {}", output.status); + println!("stdout: {}", String::from_utf8_lossy(&output.stdout)); + println!("stderr: {}", String::from_utf8_lossy(&output.stderr)); if cfg!(unix) { if code.is_none() { - let signal = get_signal(self.get_output().status).unwrap(); + let signal = get_signal(output.status).unwrap(); panic!("INTERRUPTED with signal: {}", signal); } } let actual_code = code.unwrap(); - panic!("Non zero exit code: {}", actual_code); + println!("code: {}", actual_code); + panic!("Non zero exit code"); } self } -- cgit v1.2.3