Merge pull request #4656 from roc-lang/wasm_interp_test_reorg

Wasm interp test reorg
This commit is contained in:
Folkert de Vries 2022-12-02 11:08:31 +01:00 committed by GitHub
commit 0cb26bf50c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 21 additions and 14 deletions

View File

@ -1,18 +1,14 @@
mod call_stack;
mod instance;
pub mod test_utils;
mod tests;
mod value_stack;
pub mod wasi;
// Main external interface
pub use instance::Instance;
// Exposed for testing only. Should eventually become private.
pub use call_stack::CallStack;
pub use instance::Action;
pub use value_stack::ValueStack;
use roc_wasm_module::Value;
use value_stack::ValueStack;
pub trait ImportDispatcher {
/// Dispatch a call from WebAssembly to your own code, based on module and function name.

View File

@ -1,3 +1,13 @@
#![cfg(test)]
mod test_basics;
mod test_convert;
mod test_f32;
mod test_f64;
mod test_i32;
mod test_i64;
mod test_mem;
use crate::{DefaultImportDispatcher, Instance, DEFAULT_IMPORTS};
use bumpalo::{collections::Vec, Bump};
use roc_wasm_module::{

View File

@ -1,8 +1,8 @@
#![cfg(test)]
use super::{const_value, create_exported_function_no_locals, default_state};
use crate::{instance::Action, ImportDispatcher, Instance, ValueStack, DEFAULT_IMPORTS};
use bumpalo::{collections::Vec, Bump};
use roc_wasm_interp::test_utils::{const_value, create_exported_function_no_locals, default_state};
use roc_wasm_interp::{Action, ImportDispatcher, Instance, ValueStack, DEFAULT_IMPORTS};
use roc_wasm_module::sections::{Import, ImportDesc};
use roc_wasm_module::{
opcodes::OpCode, sections::ElementSegment, Export, ExportType, SerialBuffer, Serialize,

View File

@ -1,6 +1,6 @@
#![cfg(test)]
use roc_wasm_interp::test_utils::test_op_example;
use super::test_op_example;
use roc_wasm_module::{opcodes::OpCode::*, Value};
#[test]

View File

@ -1,6 +1,6 @@
#![cfg(test)]
use roc_wasm_interp::test_utils::test_op_example;
use super::test_op_example;
use roc_wasm_module::{opcodes::OpCode, opcodes::OpCode::*, Value};
fn test_f32_comparison(op: OpCode, arg1: f32, arg2: f32, expected: bool) {

View File

@ -1,6 +1,6 @@
#![cfg(test)]
use roc_wasm_interp::test_utils::test_op_example;
use super::test_op_example;
use roc_wasm_module::{opcodes::OpCode, opcodes::OpCode::*, Value};
fn test_f64_comparison(op: OpCode, arg1: f64, arg2: f64, expected: bool) {

View File

@ -1,6 +1,6 @@
#![cfg(test)]
use roc_wasm_interp::test_utils::test_op_example;
use super::test_op_example;
use roc_wasm_module::{opcodes::OpCode, opcodes::OpCode::*, Value};
fn test_i32_binop(op: OpCode, arg1: i32, arg2: i32, expected: i32) {

View File

@ -1,6 +1,6 @@
#![cfg(test)]
use roc_wasm_interp::test_utils::test_op_example;
use super::test_op_example;
use roc_wasm_module::{opcodes::OpCode, opcodes::OpCode::*, Value};
fn test_i64_comparison(op: OpCode, arg1: i64, arg2: i64, expected: bool) {

View File

@ -1,5 +1,6 @@
use super::create_exported_function_no_locals;
use crate::{Instance, DEFAULT_IMPORTS};
use bumpalo::{collections::Vec, Bump};
use roc_wasm_interp::{test_utils::create_exported_function_no_locals, Instance, DEFAULT_IMPORTS};
use roc_wasm_module::{
opcodes::OpCode,
sections::{DataMode, DataSegment, MemorySection},