mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-06-26 21:22:13 +00:00
failing address.wast
This commit is contained in:
@ -7,11 +7,12 @@ macro_rules! run_test {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run_test!("address", wasm_address);
|
||||||
run_test!("endianness", wasm_endianness);
|
run_test!("endianness", wasm_endianness);
|
||||||
run_test!("f32", wasm_f32);
|
run_test!("f32", wasm_f32);
|
||||||
run_test!("f32_bitwise", wasm_f32_bitwise);
|
run_test!("f32_bitwise", wasm_f32_bitwise);
|
||||||
run_test!("f64", wasm_f64);
|
run_test!("f64", wasm_f64);
|
||||||
run_test!("f64_bitwise", wasm_f64_bitwise);
|
run_test!("f64_bitwise", wasm_f64_bitwise);
|
||||||
run_test!("forward", wasm_address);
|
run_test!("forward", wasm_forward);
|
||||||
run_test!("i32", wasm_i32);
|
run_test!("i32", wasm_i32);
|
||||||
run_test!("i64", wasm_i64);
|
run_test!("i64", wasm_i64);
|
||||||
|
@ -8,19 +8,32 @@ use std::sync::Arc;
|
|||||||
|
|
||||||
use serde_json;
|
use serde_json;
|
||||||
use test;
|
use test;
|
||||||
use parity_wasm;
|
use parity_wasm::{self, elements, builder};
|
||||||
use parity_wasm::interpreter::{
|
use parity_wasm::interpreter::{
|
||||||
RuntimeValue,
|
RuntimeValue,
|
||||||
ProgramInstance, ModuleInstance, ModuleInstanceInterface,
|
ProgramInstance, ModuleInstance, ModuleInstanceInterface,
|
||||||
Error as InterpreterError,
|
Error as InterpreterError,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fn spec_test_module() -> elements::Module {
|
||||||
|
builder::module()
|
||||||
|
.function()
|
||||||
|
.signature().with_param(elements::ValueType::I32).build()
|
||||||
|
.body().build()
|
||||||
|
.build()
|
||||||
|
.export().field("print").internal().func(0).build()
|
||||||
|
.build()
|
||||||
|
}
|
||||||
|
|
||||||
fn setup_program(base_dir: &str, test_module_path: &str) -> (ProgramInstance, Arc<ModuleInstance>) {
|
fn setup_program(base_dir: &str, test_module_path: &str) -> (ProgramInstance, Arc<ModuleInstance>) {
|
||||||
let mut wasm_path = PathBuf::from(base_dir.clone());
|
let mut wasm_path = PathBuf::from(base_dir.clone());
|
||||||
wasm_path.push(test_module_path);
|
wasm_path.push(test_module_path);
|
||||||
let module = parity_wasm::deserialize_file(&wasm_path)
|
let module = parity_wasm::deserialize_file(&wasm_path)
|
||||||
.expect(&format!("Wasm file {} failed to load", wasm_path.to_string_lossy()));
|
.expect(&format!("Wasm file {} failed to load", wasm_path.to_string_lossy()));
|
||||||
|
|
||||||
let program = ProgramInstance::new().expect("Failed creating program");
|
let program = ProgramInstance::new().expect("Failed creating program");
|
||||||
|
program.add_module("spectest", spec_test_module()).expect("Failed adding 'spectest' module");
|
||||||
|
|
||||||
let module_instance = program.add_module("test", module).expect("Failed adding module");
|
let module_instance = program.add_module("test", module).expect("Failed adding module");
|
||||||
(program, module_instance)
|
(program, module_instance)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user