Add *.wast support for invoking components (#4526)

This commit builds on bytecodealliance/wasm-tools#690 to add support to
testing of the component model to execute functions when running
`*.wast` files. This support is all built on #4442 as functions are
invoked through a "dynamic" API. Right now the testing and integration
is fairly crude but I'm hoping that we can try to improve it over time
as necessary. For now this should provide a hopefully more convenient
syntax for unit tests and the like.
This commit is contained in:
Alex Crichton
2022-07-27 16:02:16 -05:00
committed by GitHub
parent 0508932174
commit 174b60dcf7
25 changed files with 1154 additions and 468 deletions

View File

@@ -3,8 +3,9 @@
use arbitrary::{Arbitrary, Result, Unstructured};
use std::ops::RangeInclusive;
use wasm_encoder::{
CodeSection, EntityType, ExportKind, ExportSection, Function, FunctionSection, GlobalSection,
ImportSection, Instruction, Module, TableSection, TableType, TypeSection, ValType,
CodeSection, ConstExpr, EntityType, ExportKind, ExportSection, Function, FunctionSection,
GlobalSection, ImportSection, Instruction, Module, TableSection, TableType, TypeSection,
ValType,
};
/// A description of a Wasm module that makes a series of `externref` table
@@ -94,7 +95,7 @@ impl TableOps {
val_type: wasm_encoder::ValType::ExternRef,
mutable: true,
},
&Instruction::RefNull(wasm_encoder::ValType::ExternRef),
&ConstExpr::ref_null(wasm_encoder::ValType::ExternRef),
);
}