Add a new style of test suite for the witx
tooling similar to *.wast
#392
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.
These commits add a new
*.witxt
style of test suite to be similar to the*.wast
style of test suites. (supposed to be shorthand for "witx test")Most existing tests have been converted to the
*.witxt
style of test as an example. There's a few goals from this translation:*.witxt
file is quite easy and low-overhead. The intention is to make the barrier-to-entry on adding test extremely low.witx
crate change.witx
grows and expands this is intended to make it easier to add new classes of test suites. We'll in theory already have a lot of witx documents in the test suite already and are used to writing inline witx documents, so adding future functionality should be much easier to test by either reusing existing test directives or adding a small handful of new directives.For example one thing I'd like to add stricter tests for on #391 is the elaboration of parsed types to the variant/record types. By using
assert_representation
I could reuse those definitions and existing type checking to assert this by adding a new text file here. Additionally I'd like to start codifying more of the translation of a witx signature to the expected ABI, and I believe that will be much easier with a test suite like this.Another thought on this style of test suite is that as
*.witx
usage grows beyond simply WASI we'll want the ability to test more and more pieces of functionality that aren't necessarily used by WASI itself, which means it'll get more important to have strict and exhaustive tests outside of just the*.witx
files in this repository for WASI itself.