mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-21 15:59:20 +03:00
Merge pull request #4656 from roc-lang/wasm_interp_test_reorg
Wasm interp test reorg
This commit is contained in:
commit
0cb26bf50c
@ -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.
|
||||
|
@ -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::{
|
@ -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,
|
@ -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]
|
@ -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) {
|
@ -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) {
|
@ -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) {
|
@ -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) {
|
@ -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},
|
Loading…
Reference in New Issue
Block a user