From 1663131fb135abf96e4e68a5f872d5cb282ec5e5 Mon Sep 17 00:00:00 2001 From: Henry Gressmann Date: Tue, 12 Dec 2023 09:14:26 +0100 Subject: docs: update documentation Signed-off-by: Henry Gressmann --- crates/types/README.md | 2 +- crates/wasm-testsuite/Cargo.toml | 3 ++- crates/wasm-testsuite/README.md | 20 ++++++++++++++++++++ crates/wasm-testsuite/lib.rs | 7 +------ 4 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 crates/wasm-testsuite/README.md (limited to 'crates') diff --git a/crates/types/README.md b/crates/types/README.md index 0aecbcc..f2d048b 100644 --- a/crates/types/README.md +++ b/crates/types/README.md @@ -1,3 +1,3 @@ # `tinywasm_types` -This crate contains the types used by the [`tinywasm`](https://crates.io/crates/tinywasm) crate. \ No newline at end of file +This crate contains the types used by the [`tinywasm`](https://crates.io/crates/tinywasm) crate. It is also used by the [`tinywasm_parser`](https://crates.io/crates/tinywasm_parser) crate to parse WebAssembly binaries. diff --git a/crates/wasm-testsuite/Cargo.toml b/crates/wasm-testsuite/Cargo.toml index 68f2355..30a4e58 100644 --- a/crates/wasm-testsuite/Cargo.toml +++ b/crates/wasm-testsuite/Cargo.toml @@ -2,8 +2,9 @@ name="wasm-testsuite" version="0.1.0" description="Mirror of the WebAssembly core testsuite for use in testing WebAssembly implementations" +license="Apache-2.0" +readme="README.md" edition.workspace=true -license.workspace=true authors.workspace=true repository.workspace=true diff --git a/crates/wasm-testsuite/README.md b/crates/wasm-testsuite/README.md new file mode 100644 index 0000000..c3dcde2 --- /dev/null +++ b/crates/wasm-testsuite/README.md @@ -0,0 +1,20 @@ +# `wasm-testsuite` + +This crate embeds the latest version of the [WebAssembly Test Suite](https://github.com/WebAssembly/spec/tree/main/test). It is currently mainly used for testing the `tinywasm-parser` crate. Check out the [documentation](https://docs.rs/wasm-testsuite) for more information. + +## Usage + +```rust +use wasm_testsuite::{MVP_TESTS, get_test_wast}; + +wasm_testsuite::MVP_TESTS.iter().for_each(|test| { + let wast_bytes = get_test_wast(test).expect("Failed to get wast bytes"); + let wast = std::str::from_utf8(&wast).expect("failed to convert wast to utf8"); + + // Do something with the wast (e.g. parse it using the `wast` crate) +}); +``` + +## License + +This crate is licensed under the [Apache License, Version 2.0](https://github.com/WebAssembly/spec/blob/main/test/LICENSE). \ No newline at end of file diff --git a/crates/wasm-testsuite/lib.rs b/crates/wasm-testsuite/lib.rs index 7e6afb4..9e38bfc 100644 --- a/crates/wasm-testsuite/lib.rs +++ b/crates/wasm-testsuite/lib.rs @@ -1,9 +1,4 @@ -//! This crate provides a way to access the WebAssembly spec testsuite. -//! -//! The testsuite is included as a git submodule and embedded into the binary. -//! -//! Generated from - +#![doc = include_str!("README.md")] #![forbid(unsafe_code)] #![doc(test( no_crate_inject, -- cgit v1.3.1