wasmer/src/spectests/comments.rs

89 lines
2.8 KiB
Rust
Raw Normal View History

2018-10-30 00:34:46 +01:00
// Rust test file autogenerated with cargo build (src/build_spectests.rs).
// Please do NOT modify it by hand, as it will be reseted on next build.
// Test based on spectests/comments.wast
#![allow(
warnings,
dead_code
)]
use crate::webassembly::{instantiate, compile, ImportObject, ResultObject, VmCtx, Export};
use super::_common::spectest_importobject;
use std::{f32, f64};
2018-10-30 00:34:46 +01:00
use wabt::wat2wasm;
// Line 10
fn create_module_1() -> ResultObject {
let module_str = "(module)
";
let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed");
instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated")
}
fn start_module_1(result_object: &ResultObject, vm_context: &VmCtx) {
result_object.instance.start(&vm_context);
}
// Line 52
#[test]
fn test_module_1() {
let result_object = create_module_1();
let vm_context = result_object.instance.generate_context();
// We group the calls together
start_module_1(&result_object, &vm_context);
}
fn create_module_2() -> ResultObject {
let module_str = "(module)
";
let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed");
instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated")
}
fn start_module_2(result_object: &ResultObject, vm_context: &VmCtx) {
result_object.instance.start(&vm_context);
}
// Line 62
#[test]
fn test_module_2() {
let result_object = create_module_2();
let vm_context = result_object.instance.generate_context();
// We group the calls together
start_module_2(&result_object, &vm_context);
}
fn create_module_3() -> ResultObject {
let module_str = "(module)
";
let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed");
instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated")
}
fn start_module_3(result_object: &ResultObject, vm_context: &VmCtx) {
result_object.instance.start(&vm_context);
}
// Line 71
#[test]
fn test_module_3() {
let result_object = create_module_3();
let vm_context = result_object.instance.generate_context();
// We group the calls together
start_module_3(&result_object, &vm_context);
}
fn create_module_4() -> ResultObject {
let module_str = "(module)
";
let wasm_binary = wat2wasm(module_str.as_bytes()).expect("WAST not valid or malformed");
instantiate(wasm_binary, spectest_importobject()).expect("WASM can't be instantiated")
}
fn start_module_4(result_object: &ResultObject, vm_context: &VmCtx) {
result_object.instance.start(&vm_context);
}
#[test]
fn test_module_4() {
let result_object = create_module_4();
let vm_context = result_object.instance.generate_context();
// We group the calls together
start_module_4(&result_object, &vm_context);
}