-
Notifications
You must be signed in to change notification settings - Fork 473
New test format #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New test format #146
Conversation
I like this though for me this would not work in a long term. You'd like in theory to have a debug version that follows this and a non-debug that does not require the testing like this. So it seems to me that we would need a $init_debug or something. Plus we still need to define correctly how the module defines this $init method, no? |
I don't think making Right now all our tests are valid module definitions with a bit of non-spec-compliant goo outside for testing, and it's trivial to strip the outside stuff. This approach destroys that. |
The I suppose the actual idea would be to use regular calls. But either way, I don't think this is a particularly useful direction:
|
Thanks for all the feedback! The initial PR really had a few errors, The idea of the PR is to remove three things that are AFAIK not
The reasons for the removal are:
The way this PR addresses those issues is that it
It should be mentioned that the proposed changes are only intended I don't want to propose a testing framework (think xUnit) or any I don't have a problem with implementing the proposed changes, Feedback is welcome! NOTE: The first version proposed a |
Making the test assertions a part of the compiled module is mostly a distraction. They're not a part of the spec, they're host features. Exhaustively authoring tests as part of the module means that we need to introduce a lot of code into the modules to support the tests, and now the tests are a part of the module so we need exhaustive automated testing for the test framework (since it's wasm and can break, and if it breaks we're no longer actually validating whether the wasm modules work.) We also have to add new features to enable this wholesale transition - how will you write assert_trap assertions as part of a wasm module? I don't think generating the current test syntax from code is that bad, either. It's awkward, but feasible: |
Support for a debug trap operator seems fine to me. These can be very helpful in complex debug situations, and upper layers might insert them when debugging code, for example to watch an access to a specific memory location etc. The operator could be very simple and just include a text string with no arguments to limit it's effect on code generation, or optionally take some arguments. |
Woops, totally forgot to update this. Closing this PR. If someone else has the problem handling the @JSStats there is a |
WAVM/WAVM#225 [simd] Add more literal tests for splat ops Part of WAVM/WAVM#195
This updates the explainer text according to the new spec we agreed in the 09-15-2020 CG meeting and discussions afterwards. The following are modifications and clarifications we made after the 09-15-2020 CG meeting, and the relevant issue posts, if any: https://github.com/WebAssembly/meetings/blob/master/main/2020/CG-09-15.md - `catch_br` wasm renamed to `delegate` (WebAssembly#133) - `rethrow` gains an immediate argument (WebAssembly#126) - Removed dependences on the reference types proposal and the multivalue proposal. The multivalue proposal was previously listed as dependent because 1. `try` is basically a `block`, so it can have multivalue input/output 2. `br_on_exn` can extract multiple values from a `block`. We don't have `br_on_exn` anymore, and I'm not sure 1 is a strong enough reason to make it a dependence. - Mention `rethrow` cannot rethrow exceptions caught by `unwind` (WebAssembly#142 and WebAssembly#137) - Mention some runtimes, especially web VMs, can attach stack traces to the exception object, implying stack traces are not required for all VMs - Update label/validation rules for `delegate` and `rethrow` (WebAssembly#146) - Finalize opcodes for `delegate` (0x18) and `catch_all` (0x19) (WebAssembly#145 and WebAssembly#147) I believe this resolves many previous issue threads, so I'll close them. Please reopen them if you think there are things left for discussions in those issues. Resolves WebAssembly#113, resolves WebAssembly#126, resolves WebAssembly#127, resolves WebAssembly#128, resolves WebAssembly#130, resolves WebAssembly#142, resolves WebAssembly#145, resolves WebAssembly#146, resolves WebAssembly#147.
As discussed with @sunfishcode a small example how the test would be more confirming to the design document.
Notes:
$init
function is the placeholder name for a function that is called after the module is loaded (same idea as behind ES6 main or .init_array sections. See Define a start function. design#398 ). All test code (e.g.invoke ...
) that was previously floating around without a related module can be moved there.