Only run runtime_core tests on Android

This commit is contained in:
Mark McCaskey
2020-04-06 14:13:54 -07:00
parent 9d312f4500
commit b6011d5dc4
3 changed files with 241 additions and 235 deletions

View File

@ -1,23 +1,25 @@
mod runtime_core_tests;
use runtime_core_tests::{get_compiler, wat2wasm};
use wasmer_runtime_core::{compile_with, imports};
pub mod runtime_core_exception_handling {
use super::runtime_core_tests::{get_compiler, wat2wasm};
use wasmer_runtime_core::{compile_with, imports};
#[test]
fn exception_handling_works() {
const MODULE: &str = r#"
#[test]
fn exception_handling_works() {
const MODULE: &str = r#"
(module
(func (export "throw_trap")
unreachable
))
"#;
let wasm_binary = wat2wasm(MODULE.as_bytes()).expect("WAST not valid or malformed");
let module = compile_with(&wasm_binary, &get_compiler()).unwrap();
let wasm_binary = wat2wasm(MODULE.as_bytes()).expect("WAST not valid or malformed");
let module = compile_with(&wasm_binary, &get_compiler()).unwrap();
let imports = imports! {};
for _ in 0..2 {
let instance = module.instantiate(&imports).unwrap();
assert!(instance.call("throw_trap", &[]).is_err());
let imports = imports! {};
for _ in 0..2 {
let instance = module.instantiate(&imports).unwrap();
assert!(instance.call("throw_trap", &[]).is_err());
}
}
}