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 5b11cae commit 1423378
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ jobs:
features: ""
target: "s390x-unknown-linux-gnu"
gcc: "s390x-linux-gnu-gcc"
runner: "qemu-s390x -L /usr/s390x-linux-gnu"
- rust: stable
os: ubuntu-latest
features: ""
Expand Down Expand Up @@ -140,7 +141,7 @@ jobs:
- name: cargo build
run: cargo build --target ${{matrix.target}} ${{ matrix.features }}
- name: cargo nextest # reports segfaults in a helpful way
run: cargo nextest run --target ${{matrix.target}} ${{ matrix.features }}
run: RUNNER="${{ matrix.target }}" cargo nextest run --target ${{matrix.target}} ${{ matrix.features }}
env:
RUST_BACKTRACE: 1
CC: ${{matrix.gcc}}
Expand Down
16 changes: 14 additions & 2 deletions tests/quick.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
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;
if let Ok(runner) = env::var("RUNNER") {
let mut runner_args = runner.split(' ');
cmd = Command::new(runner_args.next().unwrap());
cmd.args(runner_args);
cmd.arg(env!("CARGO_BIN_EXE_bzip2"));
} else {
cmd = Command::new(env!("CARGO_BIN_EXE_bzip2"));
}
let output = cmd
.arg("-d")
.arg(compressed)
.arg("-c")
.stdout(std::process::Stdio::piped())
.stdout(Stdio::piped())
.output()
.unwrap();
assert!(
Expand Down

0 comments on commit 1423378

Please sign in to comment.