Skip to content

Commit

Permalink
Don't exit with expected exit code when failed to read QEMU exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-opp committed Nov 2, 2019
1 parent 736ca1b commit 3fb8a4d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/subcommand/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ pub(crate) fn runner(args: RunnerArgs) -> Result<i32, ErrorMessage> {
.map_err(|e| format!("Failed to wait for QEMU process: {}", e))?;
return Err(ErrorMessage::from("Timed Out"));
}
Some(exit_status) => match config.test_success_exit_code {
Some(code) if exit_status.code() == Some(code) => 0,
other => other.unwrap_or(1),
Some(exit_status) => {
let qemu_exit_code = exit_status.code().ok_or("Failed to read QEMU exit code")?;
match config.test_success_exit_code {
Some(code) if qemu_exit_code == code => 0,
_ => qemu_exit_code,
}
},
}
} else {
Expand Down

0 comments on commit 3fb8a4d

Please sign in to comment.