Start a wast testing harness and add some tests.
This implements a minimal wast testing harness in tests/wast.rs, which runs the wast tests under tests/wast. It also adds tests for trapping in a variety of ways, and fixes several bugs exposed by those tests.
This commit is contained in:
@@ -77,7 +77,8 @@ impl binemit::RelocSink for RelocSink {
|
||||
}
|
||||
|
||||
impl RelocSink {
|
||||
fn new() -> Self {
|
||||
/// Return a new `RelocSink` instance.
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
func_relocs: Vec::new(),
|
||||
}
|
||||
|
||||
@@ -45,7 +45,9 @@ mod module;
|
||||
mod tunables;
|
||||
mod vmcontext;
|
||||
|
||||
pub use compilation::{compile_module, Compilation, Relocation, RelocationTarget, Relocations};
|
||||
pub use compilation::{
|
||||
compile_module, Compilation, RelocSink, Relocation, RelocationTarget, Relocations,
|
||||
};
|
||||
pub use environ::{ModuleEnvironment, ModuleTranslation};
|
||||
pub use module::{DataInitializer, Export, MemoryPlan, MemoryStyle, Module, TableElements};
|
||||
pub use tunables::Tunables;
|
||||
|
||||
@@ -80,12 +80,11 @@ pub struct MemoryPlan {
|
||||
}
|
||||
|
||||
impl MemoryPlan {
|
||||
/// Draw up a plan for implementing `Memory`.
|
||||
/// Draw up a plan for implementing a `Memory`.
|
||||
pub fn for_memory(memory: Memory, tunables: &Tunables) -> Self {
|
||||
Self {
|
||||
memory,
|
||||
style: MemoryStyle::for_memory(memory, tunables),
|
||||
// fixme: saturate this
|
||||
offset_guard_size: tunables.offset_guard_size,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user