Skip to content

Commit

Permalink
Ensure all examples are tested in both debug and release modes
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Jan 4, 2022
1 parent 8a6cb60 commit cb558c4
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions examples/early_exit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,8 @@ fn main() -> anyhow::Result<()> {
},
}
}

#[test]
fn test_early_exit() -> anyhow::Result<()> {
main()
}
5 changes: 5 additions & 0 deletions examples/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,8 @@ fn main() -> anyhow::Result<()> {

Ok(())
}

#[test]
fn test_features() -> anyhow::Result<()> {
main()
}
5 changes: 5 additions & 0 deletions examples/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,8 @@ fn main() -> anyhow::Result<()> {

Ok(())
}

#[test]
fn test_hello_world() -> anyhow::Result<()> {
main()
}
5 changes: 5 additions & 0 deletions examples/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,8 @@ fn main() -> anyhow::Result<()> {

Ok(())
}

#[test]
fn test_memory() -> anyhow::Result<()> {
main()
}
5 changes: 5 additions & 0 deletions examples/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,8 @@ fn main() -> anyhow::Result<()> {

Ok(())
}

#[test]
fn test_table() -> anyhow::Result<()> {
main()
}

0 comments on commit cb558c4

Please sign in to comment.