This repository contains infrastructure to test the various WebAssembly runtimes, to see how compatible they are with the official wasm-c-api.
Install the commands listed under the Prerequisites section.
Then execute the file test_runtimes.sh
.
The wasm-c-api project provides the official C API for WebAssembly
runtimes. It does so by publishing the file wasm.h
. This project also
provides some example programs to demonstrate the features of WebAssembly, and
also demonstrate how to embed a WebAssembly runtime in C programs.
The test_runtimes.sh
script downloads the wasm-c-api code. For each
WebAssembly runtime, it then downloads code of the runtime, and compiles the
runtime into a library. It then builds the example programs provided by the
wasm-c-api project. To build the examples, the script uses the wasm.h
file
published by the wasm-c-api project, and the library from the runtime. It
finally runs the resulting executable, to determine if the example works
successfully with the runtime under test.
- Git
- Make
- Rust and Cargo; commands from the Rust ecosystem.
- A C compiler (script invokes it using
cc
command).
Legend: X => fail.
Program | Wasmtime | Wasmer |
---|---|---|
callback.c | pass | pass |
finalize.c | X | X |
global.c | X | pass |
hello.c | pass | pass |
hostref.c | X | X |
memory.c | X | pass |
multi.c | pass | pass |
reflect.c | pass | pass |
serialize.c | pass | pass |
start.c | X | pass |
table.c | X | X |
threads.c | pass | X |
trap.c | pass | pass |