Skip to content

Commit

Permalink
Add wasm-audio-worklet example
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaslihotzki committed Sep 26, 2022
1 parent a9e4163 commit 287b461
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions crates/example-tests/tests/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ use std::str;

use example_tests::{example_dir, run, test_example};

async fn test_shell_example(name: &str) -> anyhow::Result<()> {
async fn test_shell_example(name: &str, envs: &[(&str, &str)]) -> anyhow::Result<()> {
test_example(name, || {
let path = example_dir(name);
run(Command::new(path.join("build.sh")).current_dir(&path))?;
run(Command::new(path.join("build.sh"))
.current_dir(&path)
.envs(envs.iter().copied()))?;
Ok(path)
})
.await
Expand All @@ -24,7 +26,7 @@ macro_rules! shell_tests {
$(#[$attr])*
#[tokio::test]
async fn $test() -> anyhow::Result<()> {
test_shell_example($name).await
test_shell_example($name, &[]).await
}
)*
};
Expand All @@ -42,15 +44,12 @@ shell_tests! {

#[tokio::test]
async fn raytrace_parallel() -> anyhow::Result<()> {
test_example("raytrace-parallel", || {
let path = example_dir("raytrace-parallel");

run(Command::new(path.join("build.sh"))
.current_dir(&path)
// This example requires nightly.
.env("RUSTUP_TOOLCHAIN", "nightly"))?;
// This example requires nightly.
test_shell_example("raytrace-parallel", &[("RUSTUP_TOOLCHAIN", "nightly")]).await
}

Ok(path)
})
.await
#[tokio::test]
async fn wasm_audio_worklet() -> anyhow::Result<()> {
// This example requires nightly.
test_shell_example("wasm-audio-worklet", &[("RUSTUP_TOOLCHAIN", "nightly")]).await
}

0 comments on commit 287b461

Please sign in to comment.