diff options
author | Ondřej Čertík <ondrej@certik.us> | 2020-01-15 23:34:30 -0700 |
---|---|---|
committer | Ondřej Čertík <ondrej@certik.us> | 2020-01-15 23:36:57 -0700 |
commit | a9b2a4aaf145a55c54642d4592d92c739e3a4b0f (patch) | |
tree | e71b092a30313bc1124ec151e7dada38049c86bd | |
parent | 322ef7812ff80510f7219e7ca5703cc5f38decd3 (diff) | |
download | fpm-a9b2a4aaf145a55c54642d4592d92c739e3a4b0f.tar.gz fpm-a9b2a4aaf145a55c54642d4592d92c739e3a4b0f.zip |
Print stderr and stdout
-rw-r--r-- | tests/cli.rs | 11 |
1 files changed, 8 insertions, 3 deletions
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<i32> { 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 } |