Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ This directory contains Component Model reference tests, grouped by functionalit

A single `.wast` test can be run with full backtrace on trap via:
```
WASMTIME_BACKTRACE_DETAILS=1 WAST_STRICT_COMPONENT_INDICES=1 wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements the-test.wast
WASMTIME_BACKTRACE_DETAILS=1 WAST_STRICT_COMPONENT_INDICES=1 wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements -W component-model-fixed-length-lists -W component-model-map the-test.wast
```

Sometimes test land ahead of the implementation and fail for a while. These
tests are listed in 'nyi.txt' so that they can be filtered out. Thus, a simple
way to run all the reference tests is:
```
find . -name "*.wast" | grep -vxFf nyi.txt | WAST_STRICT_COMPONENT_INDICES=1 xargs wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements
find . -name "*.wast" | grep -vxFf nyi.txt | WAST_STRICT_COMPONENT_INDICES=1 xargs wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements -W component-model-fixed-length-lists -W component-model-map
```
3 changes: 0 additions & 3 deletions test/async/cancellable.wast
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,6 @@
;; cancel; completes immediately (C is in cancellable yield)
(local.set $ret (call $subtask.cancel (local.get $subtask)))
(if (i32.ne (i32.const 4 (; CANCELLED_BEFORE_RETURNED ;)) (local.get $ret))
;; TODO: this currently fails in Wasmtime due to cancellable
;; thread.yield not being directly resumed by subtask.cancel, but it
;; seems like it should pass:
(then unreachable))
(call $subtask.drop (local.get $subtask))

Expand Down
49 changes: 23 additions & 26 deletions test/async/trap-if-block-and-sync.wast
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
(import "" "task.return" (func $task.return (param i32)))
(import "" "subtask.cancel" (func $subtask.cancel (param i32) (result i32)))
(import "" "thread.yield" (func $thread.yield (result i32)))
;;(import "" "thread.yield-to" (func $thread.yield-to (param i32) (result i32)))
;;(import "" "thread.switch-to" (func $thread.switch-to (param i32) (result i32)))
;;(import "" "thread.resume-later" (func $thread.resume-later (param i32)))
(import "" "thread.yield-then-resume" (func $thread.yield-then-resume (param i32) (result i32)))
(import "" "thread.suspend-then-resume" (func $thread.suspend-then-resume (param i32) (result i32)))
(import "" "thread.resume-later" (func $thread.resume-later (param i32)))
(import "" "thread.index" (func $thread-index (result i32)))
(import "" "thread.suspend" (func $thread.suspend (result i32)))
(import "" "thread.new-indirect" (func $thread.new-indirect (param i32 i32) (result i32)))
Expand Down Expand Up @@ -126,23 +126,20 @@
)
(func $thread-start-noop (param i32))
(elem (table $indirect-function-table) (i32.const 0) func $thread-start-noop)
(func (export "yield-to-is-fine") (result i32)
;; TODO: rename and reenable
;;(drop (call $thread.yield-to (call $thread.new-indirect (i32.const 0) (i32.const 0))))
(func (export "yield-then-resume-is-fine") (result i32)
(drop (call $thread.yield-then-resume (call $thread.new-indirect (i32.const 0) (i32.const 0))))
(i32.const 42)
)
(func $thread-start-switch-back (param i32)
;;(drop (call $thread.switch-to (local.get 0)))
(func $thread-start-resume-back (param i32)
(drop (call $thread.suspend-then-resume (local.get 0)))
)
(elem (table $indirect-function-table) (i32.const 1) func $thread-start-switch-back)
(func (export "switch-to-is-fine") (result i32)
;; TODO: rename and reenable
;;(drop (call $thread.switch-to (call $thread.new-indirect (i32.const 1) (call $thread-index))))
(elem (table $indirect-function-table) (i32.const 1) func $thread-start-resume-back)
(func (export "suspend-then-resume-is-fine") (result i32)
(drop (call $thread.suspend-then-resume (call $thread.new-indirect (i32.const 1) (call $thread-index))))
(i32.const 42)
)
(func (export "resume-later-is-fine") (result i32)
;; TODO: rename and reenable
;;(call $thread.resume-later (call $thread.new-indirect (i32.const 0) (i32.const 0)))
(call $thread.resume-later (call $thread.new-indirect (i32.const 0) (i32.const 0)))
(i32.const 42)
)
(func (export "trap-if-sync-cancel")
Expand Down Expand Up @@ -192,9 +189,9 @@
(canon subtask.cancel (core func $subtask.cancel))
(canon thread.yield (core func $thread.yield))
(canon thread.suspend (core func $thread.suspend))
;;(canon thread.yield-to (core func $thread.yield-to))
;;(canon thread.switch-to (core func $thread.switch-to))
;;(canon thread.resume-later (core func $thread.resume-later))
(canon thread.yield-then-resume (core func $thread.yield-then-resume))
(canon thread.suspend-then-resume (core func $thread.suspend-then-resume))
(canon thread.resume-later (core func $thread.resume-later))
(canon thread.index (core func $thread.index))
(canon waitable.join (core func $waitable.join))
(canon waitable-set.new (core func $waitable-set.new))
Expand All @@ -217,9 +214,9 @@
(export "subtask.cancel" (func $subtask.cancel))
(export "thread.yield" (func $thread.yield))
(export "thread.suspend" (func $thread.suspend))
;;(export "thread.yield-to" (func $thread.yield-to))
;;(export "thread.switch-to" (func $thread.switch-to))
;;(export "thread.resume-later" (func $thread.resume-later))
(export "thread.yield-then-resume" (func $thread.yield-then-resume))
(export "thread.suspend-then-resume" (func $thread.suspend-then-resume))
(export "thread.resume-later" (func $thread.resume-later))
(export "thread.index" (func $thread.index))
(export "thread.new-indirect" (func $thread.new-indirect))
(export "waitable.join" (func $waitable.join))
Expand All @@ -245,8 +242,8 @@
(func (export "trap-if-invalid-callback-code") async (param "invalid-code" u32) (canon lift (core func $core "trap-if-invalid-callback-code") async (callback (core func $core "unreachable-cb"))))
(func (export "yield-is-fine") (result u32) (canon lift (core func $core "yield-is-fine")))
(func (export "yield-is-fine-cb") async (result u32) (canon lift (core func $core "yield-is-fine-cb") async (callback (core func $core "return-42-cb"))))
(func (export "yield-to-is-fine") (result u32) (canon lift (core func $core "yield-to-is-fine")))
(func (export "switch-to-is-fine") (result u32) (canon lift (core func $core "switch-to-is-fine")))
(func (export "yield-then-resume-is-fine") (result u32) (canon lift (core func $core "yield-then-resume-is-fine")))
(func (export "suspend-then-resume-is-fine") (result u32) (canon lift (core func $core "suspend-then-resume-is-fine")))
(func (export "resume-later-is-fine") (result u32) (canon lift (core func $core "resume-later-is-fine")))
(func (export "trap-if-sync-call-async1") (canon lift (core func $core "trap-if-sync-call-async1")))
(func (export "trap-if-sync-call-async2") (canon lift (core func $core "trap-if-sync-call-async2")))
Expand All @@ -272,8 +269,8 @@
(func (export "trap-if-invalid-callback-code") (alias export $d "trap-if-invalid-callback-code"))
(func (export "yield-is-fine") (alias export $d "yield-is-fine"))
(func (export "yield-is-fine-cb") (alias export $d "yield-is-fine-cb"))
(func (export "yield-to-is-fine") (alias export $d "yield-to-is-fine"))
(func (export "switch-to-is-fine") (alias export $d "switch-to-is-fine"))
(func (export "yield-then-resume-is-fine") (alias export $d "yield-then-resume-is-fine"))
(func (export "suspend-then-resume-is-fine") (alias export $d "suspend-then-resume-is-fine"))
(func (export "resume-later-is-fine") (alias export $d "resume-later-is-fine"))
(func (export "trap-if-sync-cancel") (alias export $d "trap-if-sync-cancel"))
(func (export "trap-if-sync-stream-read") (alias export $d "trap-if-sync-stream-read"))
Expand Down Expand Up @@ -309,9 +306,9 @@
(component instance $i $Tester)
(assert_return (invoke "yield-is-fine-cb") (u32.const 42))
(component instance $i $Tester)
(assert_return (invoke "yield-to-is-fine") (u32.const 42))
(assert_return (invoke "yield-then-resume-is-fine") (u32.const 42))
(component instance $i $Tester)
(assert_return (invoke "switch-to-is-fine") (u32.const 42))
(assert_return (invoke "suspend-then-resume-is-fine") (u32.const 42))
(component instance $i $Tester)
(assert_return (invoke "resume-later-is-fine") (u32.const 42))
(component instance $i $Tester)
Expand Down
Loading
Loading