Skip to content

Commit

Permalink
test: Move legacy exception handling tests (NFC) (WebAssembly#2498)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoniEx2 authored Oct 31, 2024
1 parent 6a5cbb9 commit da297e0
Show file tree
Hide file tree
Showing 17 changed files with 119 additions and 734 deletions.
22 changes: 22 additions & 0 deletions test/spec/exception-handling/legacy/rethrow.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/rethrow.wast
;;; ARGS*: --enable-exceptions
(;; STDOUT ;;;
out/test/spec/exception-handling/legacy/rethrow.wast:75: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:77: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:80: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:82: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:84: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:85: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:91: assert_exception passed
out/test/spec/exception-handling/legacy/rethrow.wast:93: assert_invalid passed:
out/test/spec/exception-handling/legacy/rethrow/rethrow.1.wasm:0000019: error: rethrow not in try catch block
0000019: error: OnRethrowExpr callback failed
out/test/spec/exception-handling/legacy/rethrow.wast:94: assert_invalid passed:
out/test/spec/exception-handling/legacy/rethrow/rethrow.2.wasm:000001b: error: rethrow not in try catch block
000001b: error: OnRethrowExpr callback failed
out/test/spec/exception-handling/legacy/rethrow.wast:95: assert_invalid passed:
out/test/spec/exception-handling/legacy/rethrow/rethrow.3.wasm:000001b: error: rethrow not in try catch block
000001b: error: OnRethrowExpr callback failed
16/16 tests passed.
;;; STDOUT ;;)
20 changes: 20 additions & 0 deletions test/spec/exception-handling/legacy/throw.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/throw.wast
;;; ARGS*: --enable-exceptions
(;; STDOUT ;;;
out/test/spec/exception-handling/legacy/throw.wast:38: assert_exception passed
out/test/spec/exception-handling/legacy/throw.wast:39: assert_exception passed
out/test/spec/exception-handling/legacy/throw.wast:41: assert_exception passed
out/test/spec/exception-handling/legacy/throw.wast:42: assert_exception passed
out/test/spec/exception-handling/legacy/throw.wast:43: assert_exception passed
out/test/spec/exception-handling/legacy/throw.wast:47: assert_invalid passed:
out/test/spec/exception-handling/legacy/throw/throw.1.wasm:0000019: error: tag variable out of range: 0 (max 0)
0000019: error: OnThrowExpr callback failed
out/test/spec/exception-handling/legacy/throw.wast:48: assert_invalid passed:
out/test/spec/exception-handling/legacy/throw/throw.2.wasm:0000022: error: type mismatch in throw, expected [i32] but got []
0000022: error: OnThrowExpr callback failed
out/test/spec/exception-handling/legacy/throw.wast:50: assert_invalid passed:
out/test/spec/exception-handling/legacy/throw/throw.3.wasm:0000024: error: type mismatch in throw, expected [i32] but got [i64]
0000024: error: OnThrowExpr callback failed
11/11 tests passed.
;;; STDOUT ;;)
39 changes: 39 additions & 0 deletions test/spec/exception-handling/legacy/try_catch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/try_catch.wast
;;; ARGS*: --enable-exceptions --enable-tail-call
(;; STDOUT ;;;
out/test/spec/exception-handling/legacy/try_catch.wast:185: assert_trap passed: unreachable executed
out/test/spec/exception-handling/legacy/try_catch.wast:188: assert_trap passed: integer divide by zero
out/test/spec/exception-handling/legacy/try_catch.wast:192: assert_exception passed
out/test/spec/exception-handling/legacy/try_catch.wast:196: assert_exception passed
out/test/spec/exception-handling/legacy/try_catch.wast:219: assert_exception passed
out/test/spec/exception-handling/legacy/try_catch.wast:220: assert_exception passed
out/test/spec/exception-handling/legacy/try_catch.wast:248: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.3.wat:1:16: error: unexpected token "catch_all", expected an instr.
(module (func (catch_all)))
^^^^^^^^^
out/test/spec/exception-handling/legacy/try_catch.wast:253: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.4.wat:1:25: error: unexpected token "catch", expected an instr.
(module (tag $e) (func (catch $e)))
^^^^^
out/test/spec/exception-handling/legacy/try_catch.wast:258: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.5.wat:1:38: error: multiple catch_all clauses not allowed
(module (func (try (do) (catch_all) (catch_all))))
^^^^^^^^^
out/test/spec/exception-handling/legacy/try_catch.wast:264: assert_invalid passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.6.wasm:000001b: error: type mismatch in try, expected [i32] but got []
000001b: error: OnEndExpr callback failed
out/test/spec/exception-handling/legacy/try_catch.wast:266: assert_invalid passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.7.wasm:000001d: error: type mismatch in try, expected [i32] but got [i64]
000001d: error: OnEndExpr callback failed
out/test/spec/exception-handling/legacy/try_catch.wast:268: assert_invalid passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.8.wasm:0000023: error: type mismatch at end of try catch, expected [] but got [i32]
0000023: error: OnEndExpr callback failed
out/test/spec/exception-handling/legacy/try_catch.wast:270: assert_invalid passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.9.wasm:0000028: error: type mismatch in try catch, expected [i32] but got [i64]
0000028: error: OnEndExpr callback failed
out/test/spec/exception-handling/legacy/try_catch.wast:275: assert_invalid passed:
out/test/spec/exception-handling/legacy/try_catch/try_catch.10.wasm:000001d: error: type mismatch at end of try catch, expected [] but got [i32]
000001d: error: OnEndExpr callback failed
42/42 tests passed.
;;; STDOUT ;;)
32 changes: 32 additions & 0 deletions test/spec/exception-handling/legacy/try_delegate.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
;;; TOOL: run-interp-spec
;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/try_delegate.wast
;;; ARGS*: --enable-exceptions --enable-tail-call
(;; STDOUT ;;;
out/test/spec/exception-handling/legacy/try_delegate.wast:195: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:198: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:200: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:208: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:209: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:213: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:214: assert_exception passed
out/test/spec/exception-handling/legacy/try_delegate.wast:222: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_delegate/try_delegate.1.wat:1:16: error: unexpected token "delegate", expected an instr.
(module (func (delegate 0)))
^^^^^^^^
out/test/spec/exception-handling/legacy/try_delegate.wast:227: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_delegate/try_delegate.2.wat:1:46: error: unexpected token delegate, expected ).
(module (tag $e) (func (try (do) (catch $e) (delegate 0))))
^^^^^^^^
out/test/spec/exception-handling/legacy/try_delegate.wast:232: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_delegate/try_delegate.3.wat:1:38: error: unexpected token delegate, expected ).
(module (func (try (do) (catch_all) (delegate 0))))
^^^^^^^^
out/test/spec/exception-handling/legacy/try_delegate.wast:237: assert_malformed passed:
out/test/spec/exception-handling/legacy/try_delegate/try_delegate.4.wat:1:34: error: unexpected token ")", expected a numeric index or a name (e.g. 12 or $foo).
(module (func (try (do) (delegate) (delegate 0))))
^
out/test/spec/exception-handling/legacy/try_delegate.wast:242: assert_invalid passed:
out/test/spec/exception-handling/legacy/try_delegate/try_delegate.5.wasm:000001b: error: invalid depth: 2 (max 1)
000001b: error: OnDelegateExpr callback failed
26/26 tests passed.
;;; STDOUT ;;)
22 changes: 0 additions & 22 deletions test/spec/exception-handling/rethrow.txt

This file was deleted.

20 changes: 0 additions & 20 deletions test/spec/exception-handling/throw.txt

This file was deleted.

39 changes: 0 additions & 39 deletions test/spec/exception-handling/try_catch.txt

This file was deleted.

32 changes: 0 additions & 32 deletions test/spec/exception-handling/try_delegate.txt

This file was deleted.

2 changes: 1 addition & 1 deletion test/wasm2c/spec/exception-handling/rethrow.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;;; TOOL: run-spec-wasm2c
;;; STDIN_FILE: third_party/testsuite_legacy/rethrow.wast
;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/rethrow.wast
;;; ARGS*: --enable-exceptions
(;; STDOUT ;;;
12/12 tests passed.
Expand Down
2 changes: 1 addition & 1 deletion test/wasm2c/spec/exception-handling/throw.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;;; TOOL: run-spec-wasm2c
;;; STDIN_FILE: third_party/testsuite_legacy/throw.wast
;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/throw.wast
;;; ARGS*: --enable-exceptions
(;; STDOUT ;;;
7/7 tests passed.
Expand Down
4 changes: 2 additions & 2 deletions test/wasm2c/spec/exception-handling/try_catch.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; TOOL: run-spec-wasm2c
;;; STDIN_FILE: third_party/testsuite_legacy/try_catch.wast
;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/try_catch.wast
;;; ARGS*: --enable-exceptions --enable-tail-call
(;; STDOUT ;;;
29/29 tests passed.
31/31 tests passed.
;;; STDOUT ;;)
4 changes: 2 additions & 2 deletions test/wasm2c/spec/exception-handling/try_delegate.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; TOOL: run-spec-wasm2c
;;; STDIN_FILE: third_party/testsuite_legacy/try_delegate.wast
;;; STDIN_FILE: third_party/testsuite/proposals/exception-handling/legacy/try_delegate.wast
;;; ARGS*: --enable-exceptions --enable-tail-call
(;; STDOUT ;;;
17/17 tests passed.
20/20 tests passed.
;;; STDOUT ;;)
4 changes: 0 additions & 4 deletions third_party/testsuite_legacy/README.md

This file was deleted.

96 changes: 0 additions & 96 deletions third_party/testsuite_legacy/rethrow.wast

This file was deleted.

Loading

0 comments on commit da297e0

Please sign in to comment.