Add wast source information to JS-converted test cases #1919
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the JS/HTML test conversion outputs a test name for each test, but each name is generic
(such as "#2 Test that WebAssembly compilation succeeds", where the only thing unique is a
prepended number. In the async version, the order of these tests doesn't even correspond
simply to the order of tests in the wast file because each test generates multiple assertions
as promises which do not all resolve together for the same tests. The result is hard to
interpret and debug. This is related to #1860 although this particular issue isn't in the
list there.
This PR adds a "source" argument to various functions and passes the information from
the interpreter's AST through the various conversions into the JS files. The result is test
names such as "#2 Test that WebAssembly compilation succeeds (address.wast:3)".
There are still a few non-unique names. "Reinitialize the default imports" and the wrapper
modules that are used when values can't be passed cleanly to JS aren't updated; but
those modules are not directly part of the feature under test and are less likely to fail,
so it didn't seem worth it.