Skip to content

Commit

Permalink
Fix testing for s390x
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Nov 5, 2024
1 parent f5c834f commit 6485d06
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions tests/quick.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
use std::env;
use std::process::{Command, Stdio};

fn run_test(compressed: &str, expected: &[u8]) {
let output = std::process::Command::new(env!("CARGO_BIN_EXE_bzip2"))
let mut cmd;
match env::var("RUNNER") {
Ok(runner) if !runner.is_empty() => {
let mut runner_args = runner.split(' ');
cmd = Command::new(runner_args.next().unwrap());
cmd.args(runner_args);
cmd.arg(env!("CARGO_BIN_EXE_bzip2"));
}
_ => cmd = Command::new(env!("CARGO_BIN_EXE_bzip2")),
}
let output = match cmd
.arg("-d")
.arg(compressed)
.arg("-c")
.stdout(std::process::Stdio::piped())
.stdout(Stdio::piped())
.output()
.unwrap();
{
Ok(output) => output,
Err(err) => panic!("Running {cmd:?} failed with {err:?}"),
};
assert!(
output.status.success(),
"{:?}",
"status: {:?} stderr: {:?}",
output.status,
String::from_utf8_lossy(&output.stderr)
);
assert_eq!(output.stdout, expected);
Expand Down

0 comments on commit 6485d06

Please sign in to comment.