Skip to content

Commit

Permalink
Add cfg for test build
Browse files Browse the repository at this point in the history
  • Loading branch information
sile committed Jul 14, 2024
1 parent 4184fa3 commit 3d4d646
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/call_hello.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use nowasm::{Env, HostFunc, Module, Resolve, StdVectorFactory, Val};

pub fn main() {
#[cfg(test)]
let wasm_bytes = include_bytes!("../target/wasm32-unknown-unknown/debug/examples/hello.wasm");
#[cfg(not(test))]
let wasm_bytes = &[];

let module = Module::<StdVectorFactory>::decode(wasm_bytes).expect("Failed to decode module");

Expand Down

0 comments on commit 3d4d646

Please sign in to comment.