Skip to content

Commit

Permalink
fixes, comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Pat Hickey committed May 16, 2023
1 parent e5c0a25 commit 336e465
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 25 deletions.
43 changes: 30 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 10 additions & 8 deletions crates/test-programs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ wit-component = "0.9.0"
heck = "0.4.0"

[dev-dependencies]
anyhow = { workspace = true }
tempfile = "3.1.0"
test-log = { version = "0.2", default-features = false, features = ["trace"] }
tracing = { workspace = true }
tracing-subscriber = { version = "0.3.1", default-features = false, features = ['fmt', 'env-filter'] }
lazy_static = "1"
wasmtime = { workspace = true, features = ['cranelift', 'component-model'] }

wasi-common = { workspace = true }
wasi-cap-std-sync = { workspace = true }
wasmtime = { workspace = true, features = ['cranelift'] }
wasmtime-wasi = { workspace = true, features = ["tokio"] }
target-lexicon = { workspace = true }
tracing-subscriber = { version = "0.3.1", default-features = false, features = ['fmt'] }
tempfile = "3.1.0"
os_pipe = "0.9"
anyhow = { workspace = true }
wat = { workspace = true }
cap-std = { workspace = true }
tokio = { version = "1.8.0", features = ["net", "rt-multi-thread"] }
tokio = { version = "1.8.0", features = ["net", "rt-multi-thread", "macros"] }

wasmtime-wasi-http = { workspace = true }
hyper = { version = "1.0.0-rc.3", features = ["full"] }
http = { version = "0.2.9" }
Expand Down
6 changes: 3 additions & 3 deletions crates/test-programs/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn modules_rs(meta: &cargo_metadata::Metadata, package: &str, kind: &str, out_di
format!(
"
{decls}\n
fn get_module(s: &str) -> wasmtime::Module {{
pub fn get_module(s: &str) -> wasmtime::Module {{
match s {{
{cases}
_ => panic!(\"no such module: {{}}\", s),
Expand Down Expand Up @@ -162,11 +162,11 @@ fn components_rs(
}

std::fs::write(
out_dir.join(&format!("{}_modules.rs", package.to_snake_case())),
out_dir.join(&format!("{}_components.rs", package.to_snake_case())),
format!(
"
{decls}\n
fn get_component(s: &str) -> wasmtime::component::Component {{
pub fn get_component(s: &str) -> wasmtime::component::Component {{
match s {{
{cases}
_ => panic!(\"no such component: {{}}\", s),
Expand Down
3 changes: 3 additions & 0 deletions crates/test-programs/tests/wasi-cap-std-sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ fn run(name: &str, inherit_stdio: bool) -> Result<()> {
Ok(())
}

// Below here is mechanical: there should be one test for every binary in
// wasi-tests. The only differences should be should_panic annotations for
// tests which fail.
#[test_log::test]
fn big_random_buf() {
run("big_random_buf", true).unwrap()
Expand Down
5 changes: 4 additions & 1 deletion crates/test-programs/tests/wasi-tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ async fn run(name: &str, inherit_stdio: bool) -> Result<()> {
Ok(())
}

// Below here is mechanical: there should be one test for every binary in
// wasi-tests. The only differences should be should_panic annotations for
// tests which fail.
#[test_log::test(tokio::test(flavor = "multi_thread"))]
async fn big_random_buf() {
run("big_random_buf", true).await.unwrap()
Expand Down Expand Up @@ -239,7 +242,7 @@ async fn path_rename_file_trailing_slashes() {
run("path_rename_file_trailing_slashes", false)
.await
.unwrap()
}(flavor = "multi_thread", worker_threads = 1)
}
#[test_log::test(tokio::test(flavor = "multi_thread"))]
async fn path_rename() {
run("path_rename", true).await.unwrap()
Expand Down

0 comments on commit 336e465

Please sign in to comment.