Skip to content

Commit

Permalink
Refactor wasm-abi to use cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Rejyr committed Jun 29, 2024
1 parent 68b6bb2 commit 0c1df37
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/run-make/wasm-abi/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//@ only-wasm32-wasip1
//@ needs-wasmtime

use run_make_support::rustc;
use run_make_support::{cmd, rustc};
use std::path::Path;
use std::process::Command;

fn main() {
rustc().input("foo.rs").target("wasm32-wasip1").run();
Expand All @@ -19,14 +18,12 @@ fn main() {
}

fn run(file: &Path, method: &str, expected_output: &str) {
let output = Command::new("wasmtime")
cmd("wasmtime")
.arg("run")
.arg("--preload=host=host.wat")
.arg("--invoke")
.arg(method)
.arg(file)
.output()
.unwrap();
assert!(output.status.success());
assert_eq!(expected_output, String::from_utf8_lossy(&output.stdout));
.run()
.assert_stdout_equals(expected_output);
}

0 comments on commit 0c1df37

Please sign in to comment.