mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
wasm: move linking tests to test_gen and execute the module
This commit is contained in:
parent
115c2b524e
commit
c1aa9f229a
5 changed files with 51 additions and 11 deletions
|
@ -50,7 +50,7 @@ pub fn compile_and_load<'a, T: Wasm32Result>(
|
|||
save_wasm_file(&compiled_bytes, build_dir_hash)
|
||||
};
|
||||
|
||||
load_bytes_into_runtime(compiled_bytes)
|
||||
load_bytes_into_runtime(&compiled_bytes)
|
||||
}
|
||||
|
||||
fn get_preprocessed_host_path() -> PathBuf {
|
||||
|
@ -173,12 +173,12 @@ fn save_wasm_file(app_module_bytes: &[u8], build_dir_hash: u64) {
|
|||
);
|
||||
}
|
||||
|
||||
fn load_bytes_into_runtime(bytes: Vec<u8>) -> wasmer::Instance {
|
||||
fn load_bytes_into_runtime(bytes: &[u8]) -> wasmer::Instance {
|
||||
use wasmer::{Module, Store};
|
||||
use wasmer_wasi::WasiState;
|
||||
|
||||
let store = Store::default();
|
||||
let wasmer_module = Module::new(&store, &bytes).unwrap();
|
||||
let wasmer_module = Module::new(&store, bytes).unwrap();
|
||||
|
||||
// First, we create the `WasiEnv`
|
||||
let mut wasi_env = WasiState::new("hello").finalize().unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue