Skip to content

Commit 99419dc

Browse files
committed
fix more test regressions
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
1 parent fa57e7d commit 99419dc

File tree

5 files changed

+38
-38
lines changed

5 files changed

+38
-38
lines changed

tests/all/component_model/async.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -473,33 +473,33 @@ async fn task_deletion() -> Result<()> {
473473
(export "waitable-set.new" (func $waitable-set.new))))
474474
(with "libc" (instance $libc))))
475475
476-
(func (export "explicit-thread-calls-return-stackful") (result u32)
476+
(func (export "explicit-thread-calls-return-stackful") async (result u32)
477477
(canon lift (core func $cm "explicit-thread-calls-return-stackful") async))
478-
(func (export "explicit-thread-calls-return-stackless") (result u32)
478+
(func (export "explicit-thread-calls-return-stackless") async (result u32)
479479
(canon lift (core func $cm "explicit-thread-calls-return-stackless") async (callback (func $cm "cb"))))
480-
(func (export "explicit-thread-suspends-sync") (result u32)
480+
(func (export "explicit-thread-suspends-sync") async (result u32)
481481
(canon lift (core func $cm "explicit-thread-suspends-sync")))
482-
(func (export "explicit-thread-suspends-stackful") (result u32)
482+
(func (export "explicit-thread-suspends-stackful") async (result u32)
483483
(canon lift (core func $cm "explicit-thread-suspends-stackful") async))
484-
(func (export "explicit-thread-suspends-stackless") (result u32)
484+
(func (export "explicit-thread-suspends-stackless") async (result u32)
485485
(canon lift (core func $cm "explicit-thread-suspends-stackless") async (callback (func $cm "cb"))))
486-
(func (export "explicit-thread-yield-loops-sync") (result u32)
486+
(func (export "explicit-thread-yield-loops-sync") async (result u32)
487487
(canon lift (core func $cm "explicit-thread-yield-loops-sync")))
488-
(func (export "explicit-thread-yield-loops-stackful") (result u32)
488+
(func (export "explicit-thread-yield-loops-stackful") async (result u32)
489489
(canon lift (core func $cm "explicit-thread-yield-loops-stackful") async))
490-
(func (export "explicit-thread-yield-loops-stackless") (result u32)
490+
(func (export "explicit-thread-yield-loops-stackless") async (result u32)
491491
(canon lift (core func $cm "explicit-thread-yield-loops-stackless") async (callback (func $cm "cb"))))
492492
)
493493
494494
(component $D
495-
(import "explicit-thread-calls-return-stackful" (func $explicit-thread-calls-return-stackful (result u32)))
496-
(import "explicit-thread-calls-return-stackless" (func $explicit-thread-calls-return-stackless (result u32)))
497-
(import "explicit-thread-suspends-sync" (func $explicit-thread-suspends-sync (result u32)))
498-
(import "explicit-thread-suspends-stackful" (func $explicit-thread-suspends-stackful (result u32)))
499-
(import "explicit-thread-suspends-stackless" (func $explicit-thread-suspends-stackless (result u32)))
500-
(import "explicit-thread-yield-loops-sync" (func $explicit-thread-yield-loops-sync (result u32)))
501-
(import "explicit-thread-yield-loops-stackful" (func $explicit-thread-yield-loops-stackful (result u32)))
502-
(import "explicit-thread-yield-loops-stackless" (func $explicit-thread-yield-loops-stackless (result u32)))
495+
(import "explicit-thread-calls-return-stackful" (func $explicit-thread-calls-return-stackful async (result u32)))
496+
(import "explicit-thread-calls-return-stackless" (func $explicit-thread-calls-return-stackless async (result u32)))
497+
(import "explicit-thread-suspends-sync" (func $explicit-thread-suspends-sync async (result u32)))
498+
(import "explicit-thread-suspends-stackful" (func $explicit-thread-suspends-stackful async (result u32)))
499+
(import "explicit-thread-suspends-stackless" (func $explicit-thread-suspends-stackless async (result u32)))
500+
(import "explicit-thread-yield-loops-sync" (func $explicit-thread-yield-loops-sync async (result u32)))
501+
(import "explicit-thread-yield-loops-stackful" (func $explicit-thread-yield-loops-stackful async (result u32)))
502+
(import "explicit-thread-yield-loops-stackless" (func $explicit-thread-yield-loops-stackless async (result u32)))
503503
504504
(core module $Memory (memory (export "mem") 1))
505505
(core instance $memory (instantiate $Memory))
@@ -620,7 +620,7 @@ async fn task_deletion() -> Result<()> {
620620
(export "subtask.cancel" (func $subtask.cancel))
621621
(export "thread.yield" (func $thread.yield))
622622
))))
623-
(func (export "run") (result u32) (canon lift (core func $dm "run")))
623+
(func (export "run") async (result u32) (canon lift (core func $dm "run")))
624624
)
625625
626626
(instance $c (instantiate $C))

tests/all/component_model/bindgen.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ mod one_import_concurrent {
214214
215215
export bar: async func();
216216
}
217-
",
217+
"
218218
});
219219

220220
#[tokio::test]
@@ -229,7 +229,7 @@ mod one_import_concurrent {
229229
r#"
230230
(component
231231
(import "foo" (instance $foo-instance
232-
(export "foo" (func))
232+
(export "foo" (func async))
233233
))
234234
(core module $libc
235235
(memory (export "memory") 1)
@@ -255,7 +255,7 @@ mod one_import_concurrent {
255255
))
256256
))
257257
258-
(func $f (export "bar")
258+
(func $f (export "bar") async
259259
(canon lift (core func $i "bar") async (callback (func $i "callback")))
260260
)
261261

tests/all/component_model/import.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ async fn stack_and_heap_args_and_rets_concurrent() -> Result<()> {
492492
}
493493

494494
async fn test_stack_and_heap_args_and_rets(concurrent: bool) -> Result<()> {
495-
let (body, async_lower_opts, async_lift_opts) = if concurrent {
495+
let (body, async_lower_opts, async_lift_opts, async_type) = if concurrent {
496496
(
497497
r#"
498498
(import "host" "f1" (func $f1 (param i32 i32) (result i32)))
@@ -549,6 +549,7 @@ async fn test_stack_and_heap_args_and_rets(concurrent: bool) -> Result<()> {
549549
"#,
550550
"async",
551551
r#"async (callback (func $m "callback"))"#,
552+
"async",
552553
)
553554
} else {
554555
(
@@ -594,6 +595,7 @@ async fn test_stack_and_heap_args_and_rets(concurrent: bool) -> Result<()> {
594595
"#,
595596
"",
596597
"",
598+
"",
597599
)
598600
};
599601

@@ -604,10 +606,10 @@ async fn test_stack_and_heap_args_and_rets(concurrent: bool) -> Result<()> {
604606
string string string string
605607
string string string string
606608
string))
607-
(import "f1" (func $f1 (param "a" u32) (result u32)))
608-
(import "f2" (func $f2 (param "a" $many_params) (result u32)))
609-
(import "f3" (func $f3 (param "a" u32) (result string)))
610-
(import "f4" (func $f4 (param "a" $many_params) (result string)))
609+
(import "f1" (func $f1 {async_type} (param "a" u32) (result u32)))
610+
(import "f2" (func $f2 {async_type} (param "a" $many_params) (result u32)))
611+
(import "f3" (func $f3 {async_type} (param "a" u32) (result string)))
612+
(import "f4" (func $f4 {async_type} (param "a" $many_params) (result string)))
611613
612614
(core module $libc
613615
{REALLOC_AND_FREE}
@@ -710,7 +712,7 @@ async fn test_stack_and_heap_args_and_rets(concurrent: bool) -> Result<()> {
710712
))
711713
))
712714
713-
(func (export "run")
715+
(func (export "run") {async_type}
714716
(canon lift (core func $m "run") {async_lift_opts})
715717
)
716718
)

tests/all/component_model/resources.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ async fn drop_on_owned_resource() -> Result<()> {
13231323
(component
13241324
(import "t" (type $t (sub resource)))
13251325
(import "[constructor]t" (func $ctor (result (own $t))))
1326-
(import "[method]t.foo" (func $foo (param "self" (borrow $t))))
1326+
(import "[method]t.foo" (func $foo async (param "self" (borrow $t))))
13271327
13281328
(core func $ctor (canon lower (func $ctor)))
13291329
(core func $drop (canon resource.drop $t))
@@ -1352,7 +1352,7 @@ async fn drop_on_owned_resource() -> Result<()> {
13521352
(export "drop" (func $drop))
13531353
))
13541354
))
1355-
(func (export "f") (canon lift (core func $i "f")))
1355+
(func (export "f") async (canon lift (core func $i "f")))
13561356
)
13571357
"#,
13581358
)?;
@@ -1364,11 +1364,9 @@ async fn drop_on_owned_resource() -> Result<()> {
13641364
linker
13651365
.root()
13661366
.resource("t", ResourceType::host::<MyType>(), |_, _| Ok(()))?;
1367-
linker
1368-
.root()
1369-
.func_wrap_concurrent("[constructor]t", |_cx, ()| {
1370-
Box::pin(async { Ok((Resource::<MyType>::new_own(300),)) })
1371-
})?;
1367+
linker.root().func_wrap("[constructor]t", |_, ()| {
1368+
Ok((Resource::<MyType>::new_own(300),))
1369+
})?;
13721370
linker
13731371
.root()
13741372
.func_wrap_concurrent("[method]t.foo", |_cx, (r,): (Resource<MyType>,)| {

tests/all/pulley_provenance_test_async_component.wat

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
(component
2-
(import "sleep" (func $sleep))
2+
(import "sleep" (func $sleep async))
33

44
(component $A
5-
(import "run-stackless" (func $run_stackless))
6-
(import "run-stackful" (func $run_stackful))
5+
(import "run-stackless" (func $run_stackless async))
6+
(import "run-stackful" (func $run_stackful async))
77
(core module $libc (memory (export "memory") 1))
88
(core instance $libc (instantiate $libc))
99

@@ -91,8 +91,8 @@
9191
(export "run-stackless" (func $run_stackless))
9292
(export "run-stackful" (func $run_stackful))))))
9393

94-
(func (export "run-stackless") (canon lift (core func $i "run-stackless") async (callback (func $i "cb"))))
95-
(func (export "run-stackful") (canon lift (core func $i "run-stackful") async)))
94+
(func (export "run-stackless") async (canon lift (core func $i "run-stackless") async (callback (func $i "cb"))))
95+
(func (export "run-stackful") async (canon lift (core func $i "run-stackful") async)))
9696

9797
(instance $a (instantiate $A
9898
(with "run-stackless" (func $sleep))

0 commit comments

Comments
 (0)