wasi-threads: run test suite (#5907)
* wasi-threads: run test suite This change enables the running of the wasi-threads [test suite]. It relies on a Wasmtime CLI binary being available and runs all `*.wasm` and `*.wat` files present in the test suite directory. The results of each execution are compared against a JSON spec file with the same base name as the WebAssembly module. The spec file defines the expected exit code, e.g. This commit does not yet build any `*.c` or `*.s` files from the test suite. That could be done later, perhaps upstream; in the meantime, this work is still valuable as it lays the foundation for running other WASI tests from the in-progress [wasi-testsuite] which share the same JSON spec infrastructure. [test suite]: https://github.com/WebAssembly/wasi-threads/tree/main/test/testsuite [wasi-testsuite]: https://github.com/WebAssembly/wasi-testsuite * review: move testsuite to top-level tests * fix: remove now-unnecessary wasi-threads test * fix: update testsuite submodule name * fix: ignore tests on Windows prtest:full * fix: `cfg_attr` syntax prtest:full
This commit is contained in:
@@ -7,7 +7,7 @@ use tempfile::{NamedTempFile, TempDir};
|
||||
|
||||
// Run the wasmtime CLI with the provided args and return the `Output`.
|
||||
// If the `stdin` is `Some`, opens the file and redirects to the child's stdin.
|
||||
fn run_wasmtime_for_output(args: &[&str], stdin: Option<&Path>) -> Result<Output> {
|
||||
pub fn run_wasmtime_for_output(args: &[&str], stdin: Option<&Path>) -> Result<Output> {
|
||||
let runner = std::env::vars()
|
||||
.filter(|(k, _v)| k.starts_with("CARGO_TARGET") && k.ends_with("RUNNER"))
|
||||
.next();
|
||||
|
||||
Reference in New Issue
Block a user