about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJerry Wang <jerrylwang123@gmail.com>2024-06-23 17:31:08 -0400
committerJerry Wang <jerrylwang123@gmail.com>2024-06-29 08:14:56 -0400
commit0c1df370caf489a38e8d263bb9a72565fd3ab718 (patch)
treed9f0d6dc1d4d66f30258955ecd496ef524052b61
parent68b6bb27c1d34e6cd9fe5d6c2d8f954e0f2a0690 (diff)
downloadrust-0c1df370caf489a38e8d263bb9a72565fd3ab718.tar.gz
rust-0c1df370caf489a38e8d263bb9a72565fd3ab718.zip
Refactor `wasm-abi` to use `cmd`
-rw-r--r--tests/run-make/wasm-abi/rmake.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/run-make/wasm-abi/rmake.rs b/tests/run-make/wasm-abi/rmake.rs
index 0fc326babd9..ff12bcd536e 100644
--- a/tests/run-make/wasm-abi/rmake.rs
+++ b/tests/run-make/wasm-abi/rmake.rs
@@ -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();
@@ -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);
 }