16 unstable releases (4 breaking)
new 0.5.1 | Mar 6, 2025 |
---|---|
0.4.5 | Feb 28, 2025 |
0.4.0 | Dec 28, 2024 |
0.2.2 | Mar 1, 2024 |
0.2.0 | Dec 15, 2023 |
#1115 in Parser implementations
747 downloads per month
25MB
416K
SLoC
wasm-testsuite
This repository contains copies of the WebAssembly Test Suite for all WebAssembly versions and proposals (even those that are now part of the spec).
Older tests have been ported to newer versions of the wast file format, and some tests have been modified to not fail due to relaxed validation rules in later versions.
Rust Crate
All tests are also available as a Rust crate, wasm-testsuite
, which provides utilities for iterating over the tests and parsing the wast files.
Tests cases and the wast version can change between minor versions of this crate as new tests are added or existing tests are modified, so be sure to pin the version of this crate in your Cargo.toml
(e.g. wasm-testsuite = "=0.4.4"
).
Usage
use wasm_testsuite::data::{Proposal, SpecVersion, proposal, spec};
fn main() -> eyre::Result<()> {
for test in spec(&SpecVersion::V2) {
let name = test.name();
let raw = test.raw();
let wast_directives = test.wast()?.directives();
}
for p in Proposal::all() {
for test in proposal(p) {
let name = test.name();
let raw = test.raw();
let wast_directives = test.wast()?.directives();
}
}
Ok(())
}
License
This crate is licensed under the Apache License, Version 2.0.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in wasm-testsuite
by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.
Note: The tests contained in data/
are from the WebAssembly Test Suite and are licensed under the Apache License, Version 2.0 as well.
Dependencies
~5.5MB
~103K SLoC