Module wasitests

Source
Expand description

This file will run at build time to autogenerate the WASI regression tests It will compile the files indicated in TESTS, to:executable and .wasm

  • Compile with the native rust target to get the expected output
  • Compile with the latest WASI target to get the wasm
  • Generate the test that will compare the output of running the .wasm file with wasmer with the expected output

Structsยง

NativeOutput
WasiOptions
The options provied when executed a WASI Wasm program
WasiTest
This is the structure of the .wast file

Constantsยง

WASI_TEST_SRC_DIR ๐Ÿ”’

Functionsยง

build
compile ๐Ÿ”’
Returns the a Vec of the test modules created
compile_wasm_for_version ๐Ÿ”’
compile the Wasm file for the given version of WASI
extract_args_from_source_file ๐Ÿ”’
Pulls args to the program out of a comment at the top of the file starting with โ€œ// WasiOptions:โ€
generate_native_output ๐Ÿ”’
Compile and execute the test file as native code, saving the results to be compared against later.