Skip to content

Commit d285505

Browse files
committed
Fold wasm-tools/wasmtime WAST tests into the rest of the test/ suite, removing those directories
1 parent 7972c14 commit d285505

27 files changed

Lines changed: 6458 additions & 36 deletions

test/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ This directory contains Component Model reference tests, grouped by functionalit
66

77
A single `.wast` test can be run with full backtrace on trap via:
88
```
9-
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
9+
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
1010
```
1111

1212
Sometimes test land ahead of the implementation and fail for a while. These
1313
tests are listed in 'nyi.txt' so that they can be filtered out. Thus, a simple
1414
way to run all the reference tests is:
1515
```
16-
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
16+
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
1717
```

test/async/cancellable.wast

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@
199199
;; cancel; completes immediately (C is in cancellable yield)
200200
(local.set $ret (call $subtask.cancel (local.get $subtask)))
201201
(if (i32.ne (i32.const 4 (; CANCELLED_BEFORE_RETURNED ;)) (local.get $ret))
202-
;; TODO: this currently fails in Wasmtime due to cancellable
203-
;; thread.yield not being directly resumed by subtask.cancel, but it
204-
;; seems like it should pass:
205202
(then unreachable))
206203
(call $subtask.drop (local.get $subtask))
207204

test/async/trap-if-block-and-sync.wast

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
(import "" "task.return" (func $task.return (param i32)))
5151
(import "" "subtask.cancel" (func $subtask.cancel (param i32) (result i32)))
5252
(import "" "thread.yield" (func $thread.yield (result i32)))
53-
;;(import "" "thread.yield-to" (func $thread.yield-to (param i32) (result i32)))
54-
;;(import "" "thread.switch-to" (func $thread.switch-to (param i32) (result i32)))
55-
;;(import "" "thread.resume-later" (func $thread.resume-later (param i32)))
53+
(import "" "thread.yield-then-resume" (func $thread.yield-then-resume (param i32) (result i32)))
54+
(import "" "thread.suspend-then-resume" (func $thread.suspend-then-resume (param i32) (result i32)))
55+
(import "" "thread.resume-later" (func $thread.resume-later (param i32)))
5656
(import "" "thread.index" (func $thread-index (result i32)))
5757
(import "" "thread.suspend" (func $thread.suspend (result i32)))
5858
(import "" "thread.new-indirect" (func $thread.new-indirect (param i32 i32) (result i32)))
@@ -126,23 +126,20 @@
126126
)
127127
(func $thread-start-noop (param i32))
128128
(elem (table $indirect-function-table) (i32.const 0) func $thread-start-noop)
129-
(func (export "yield-to-is-fine") (result i32)
130-
;; TODO: rename and reenable
131-
;;(drop (call $thread.yield-to (call $thread.new-indirect (i32.const 0) (i32.const 0))))
129+
(func (export "yield-then-resume-is-fine") (result i32)
130+
(drop (call $thread.yield-then-resume (call $thread.new-indirect (i32.const 0) (i32.const 0))))
132131
(i32.const 42)
133132
)
134-
(func $thread-start-switch-back (param i32)
135-
;;(drop (call $thread.switch-to (local.get 0)))
133+
(func $thread-start-resume-back (param i32)
134+
(drop (call $thread.suspend-then-resume (local.get 0)))
136135
)
137-
(elem (table $indirect-function-table) (i32.const 1) func $thread-start-switch-back)
138-
(func (export "switch-to-is-fine") (result i32)
139-
;; TODO: rename and reenable
140-
;;(drop (call $thread.switch-to (call $thread.new-indirect (i32.const 1) (call $thread-index))))
136+
(elem (table $indirect-function-table) (i32.const 1) func $thread-start-resume-back)
137+
(func (export "suspend-then-resume-is-fine") (result i32)
138+
(drop (call $thread.suspend-then-resume (call $thread.new-indirect (i32.const 1) (call $thread-index))))
141139
(i32.const 42)
142140
)
143141
(func (export "resume-later-is-fine") (result i32)
144-
;; TODO: rename and reenable
145-
;;(call $thread.resume-later (call $thread.new-indirect (i32.const 0) (i32.const 0)))
142+
(call $thread.resume-later (call $thread.new-indirect (i32.const 0) (i32.const 0)))
146143
(i32.const 42)
147144
)
148145
(func (export "trap-if-sync-cancel")
@@ -192,9 +189,9 @@
192189
(canon subtask.cancel (core func $subtask.cancel))
193190
(canon thread.yield (core func $thread.yield))
194191
(canon thread.suspend (core func $thread.suspend))
195-
;;(canon thread.yield-to (core func $thread.yield-to))
196-
;;(canon thread.switch-to (core func $thread.switch-to))
197-
;;(canon thread.resume-later (core func $thread.resume-later))
192+
(canon thread.yield-then-resume (core func $thread.yield-then-resume))
193+
(canon thread.suspend-then-resume (core func $thread.suspend-then-resume))
194+
(canon thread.resume-later (core func $thread.resume-later))
198195
(canon thread.index (core func $thread.index))
199196
(canon waitable.join (core func $waitable.join))
200197
(canon waitable-set.new (core func $waitable-set.new))
@@ -217,9 +214,9 @@
217214
(export "subtask.cancel" (func $subtask.cancel))
218215
(export "thread.yield" (func $thread.yield))
219216
(export "thread.suspend" (func $thread.suspend))
220-
;;(export "thread.yield-to" (func $thread.yield-to))
221-
;;(export "thread.switch-to" (func $thread.switch-to))
222-
;;(export "thread.resume-later" (func $thread.resume-later))
217+
(export "thread.yield-then-resume" (func $thread.yield-then-resume))
218+
(export "thread.suspend-then-resume" (func $thread.suspend-then-resume))
219+
(export "thread.resume-later" (func $thread.resume-later))
223220
(export "thread.index" (func $thread.index))
224221
(export "thread.new-indirect" (func $thread.new-indirect))
225222
(export "waitable.join" (func $waitable.join))
@@ -245,8 +242,8 @@
245242
(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"))))
246243
(func (export "yield-is-fine") (result u32) (canon lift (core func $core "yield-is-fine")))
247244
(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"))))
248-
(func (export "yield-to-is-fine") (result u32) (canon lift (core func $core "yield-to-is-fine")))
249-
(func (export "switch-to-is-fine") (result u32) (canon lift (core func $core "switch-to-is-fine")))
245+
(func (export "yield-then-resume-is-fine") (result u32) (canon lift (core func $core "yield-then-resume-is-fine")))
246+
(func (export "suspend-then-resume-is-fine") (result u32) (canon lift (core func $core "suspend-then-resume-is-fine")))
250247
(func (export "resume-later-is-fine") (result u32) (canon lift (core func $core "resume-later-is-fine")))
251248
(func (export "trap-if-sync-call-async1") (canon lift (core func $core "trap-if-sync-call-async1")))
252249
(func (export "trap-if-sync-call-async2") (canon lift (core func $core "trap-if-sync-call-async2")))
@@ -272,8 +269,8 @@
272269
(func (export "trap-if-invalid-callback-code") (alias export $d "trap-if-invalid-callback-code"))
273270
(func (export "yield-is-fine") (alias export $d "yield-is-fine"))
274271
(func (export "yield-is-fine-cb") (alias export $d "yield-is-fine-cb"))
275-
(func (export "yield-to-is-fine") (alias export $d "yield-to-is-fine"))
276-
(func (export "switch-to-is-fine") (alias export $d "switch-to-is-fine"))
272+
(func (export "yield-then-resume-is-fine") (alias export $d "yield-then-resume-is-fine"))
273+
(func (export "suspend-then-resume-is-fine") (alias export $d "suspend-then-resume-is-fine"))
277274
(func (export "resume-later-is-fine") (alias export $d "resume-later-is-fine"))
278275
(func (export "trap-if-sync-cancel") (alias export $d "trap-if-sync-cancel"))
279276
(func (export "trap-if-sync-stream-read") (alias export $d "trap-if-sync-stream-read"))
@@ -309,9 +306,9 @@
309306
(component instance $i $Tester)
310307
(assert_return (invoke "yield-is-fine-cb") (u32.const 42))
311308
(component instance $i $Tester)
312-
(assert_return (invoke "yield-to-is-fine") (u32.const 42))
309+
(assert_return (invoke "yield-then-resume-is-fine") (u32.const 42))
313310
(component instance $i $Tester)
314-
(assert_return (invoke "switch-to-is-fine") (u32.const 42))
311+
(assert_return (invoke "suspend-then-resume-is-fine") (u32.const 42))
315312
(component instance $i $Tester)
316313
(assert_return (invoke "resume-later-is-fine") (u32.const 42))
317314
(component instance $i $Tester)

0 commit comments

Comments
 (0)