Skip to content

Commit

Permalink
log stdcout and stderr in case of exit code missmatch
Browse files Browse the repository at this point in the history
  • Loading branch information
cre4ture committed Feb 27, 2024
1 parent a366644 commit eac9978
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/common/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ impl CmdResult {

#[track_caller]
pub fn code_is(&self, expected_code: i32) -> &Self {
let fails = self.code() != expected_code;
if fails {
eprintln!(
"stdout:\n{}\nstderr:\n{}",
self.stdout_str(),
self.stderr_str()
);
}
assert_eq!(self.code(), expected_code);
self
}
Expand Down

0 comments on commit eac9978

Please sign in to comment.