-
Notifications
You must be signed in to change notification settings - Fork 270
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
Add a wast
subcommand to the CLI
#2096
Conversation
This commit migrates the `tests/roundtrip.rs` file to a `wast` subcommand of the CLI. This does not actually run tests in terms of executing WebAssembly but it works as a way to parse the test and validate, so everything short of runtime execution and related errors.
With the addition of the `wast` subcommand in the previous commit there's no longer any need to have `tests/local/*`. Additionally it's now much easier to perform per-test configuration since the flags for the test are in the test itself.
Similarly to the previous commit of moving towards `wasm-tools wast` this commit migrates the spec test infrastructure to using this as well. Spec tests are now run by: * A script, `ci/generate-spec-tests.rs`, generates files in `tests/cli/spec/*.wast` to run each spec test. * Each test lists the features needed to be enabled for the test to run. * The tests are then naturally run during the `--test cli` test suite run. New automation is added to ensure that the version in-tree is up-to-date to ensure we don't creep in too many files by accident.
No longer needed!
I still want to put some finishing touches on this in terms of documentation, but in terms of review it should otherwise be good to go |
documented now 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!! This should also fix the issue of BLESS=1
and running a particular test, right?
macro_rules! adjust { | ||
($e:expr) => {{ | ||
let mut e = wast::Error::from($e); | ||
e.set_path(test); | ||
e.set_text(contents); | ||
e | ||
}}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it could just be a closure, and doesn't actually need to be a macro?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I guess because it is generic over the type of $e
it can't be a closure. blech.
You mean where you run one test, set |
I was duly inspired by #2093 to not only add such a subcommand but also restructure the test suite. I've long felt that the current test suite is a bit of a pain especially around per-test configuration since right now it's all configured in
tests/roundtrip.rs
and it's also not obvious how much configuration applies to each test. With the concept of awast
subcomand I realized that we could migrate all tests totests/cli/*
which easily afforts per-test configuration, yay!This commit thusly migrates
tests/roundtrip.rs
towasm-tools wast
and then moves all tests into thetests/cli/*
directory. Tests aren't really cleaned up at this time but it should be much easier in the future to clean things up as needed.