diff --git a/Makefile b/Makefile index aa2d1b5bc4b..c2e5c06c407 100644 --- a/Makefile +++ b/Makefile @@ -575,6 +575,7 @@ test-wasi: cargo test --release --tests $(compiler_features) -- wasi::wasitests test-examples: + cargo test $(compiler_features) --features wasi --examples cargo test --release $(compiler_features) --features wasi --examples test-integration: diff --git a/examples/early_exit.rs b/examples/early_exit.rs index 42e18b0500d..a3aad1c3074 100644 --- a/examples/early_exit.rs +++ b/examples/early_exit.rs @@ -107,3 +107,8 @@ fn main() -> anyhow::Result<()> { }, } } + +#[test] +fn test_early_exit() -> anyhow::Result<()> { + main() +} diff --git a/examples/features.rs b/examples/features.rs index ef3574d6efd..3812bf8b3d6 100644 --- a/examples/features.rs +++ b/examples/features.rs @@ -54,3 +54,8 @@ fn main() -> anyhow::Result<()> { Ok(()) } + +#[test] +fn test_features() -> anyhow::Result<()> { + main() +} diff --git a/examples/hello_world.rs b/examples/hello_world.rs index c2c34913b6f..6b68395eabc 100644 --- a/examples/hello_world.rs +++ b/examples/hello_world.rs @@ -85,3 +85,8 @@ fn main() -> anyhow::Result<()> { Ok(()) } + +#[test] +fn test_hello_world() -> anyhow::Result<()> { + main() +} diff --git a/examples/memory.rs b/examples/memory.rs index 221ec41fb75..738cf05f793 100644 --- a/examples/memory.rs +++ b/examples/memory.rs @@ -137,3 +137,8 @@ fn main() -> anyhow::Result<()> { Ok(()) } + +#[test] +fn test_memory() -> anyhow::Result<()> { + main() +} diff --git a/examples/table.rs b/examples/table.rs index 2ae33badf78..6c8056d5ef3 100644 --- a/examples/table.rs +++ b/examples/table.rs @@ -152,3 +152,8 @@ fn main() -> anyhow::Result<()> { Ok(()) } + +#[test] +fn test_table() -> anyhow::Result<()> { + main() +}