Skip to content

Commit

Permalink
Only run runtime_core tests on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed Apr 6, 2020
1 parent 9d312f4 commit b6011d5
Show file tree
Hide file tree
Showing 3 changed files with 240 additions and 234 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ test: spectests emtests middleware wasitests test-rest examples

test-android:
ci/run-docker.sh x86_64-linux-android --manifest-path=lib/singlepass-backend/Cargo.toml
ci/run-docker.sh x86_64-linux-android
ci/run-docker.sh x86_64-linux-android runtime_core

# Integration tests
integration-tests: release-clif examples
Expand Down
24 changes: 13 additions & 11 deletions tests/exception_handling.rs
Original file line number Diff line number Diff line change
@@ -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());
}
}
}
Loading

0 comments on commit b6011d5

Please sign in to comment.