Skip to content

Migrate all tests to using world-file-syntax#432

Merged
alexcrichton merged 9 commits intobytecodealliance:mainfrom
alexcrichton:remove-interface-parse-file
Nov 15, 2022
Merged

Migrate all tests to using world-file-syntax#432
alexcrichton merged 9 commits intobytecodealliance:mainfrom
alexcrichton:remove-interface-parse-file

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit migrates all of tests/codegen/*.wit and tests/runtime/**/*.wit to using world files rather than per-file interfaces. After this there's no more in-tree usage of Interface::parse_file and I'll remove that as a follow-up.

Most of the changes here are mechanical changes to the tests, but various code generators also received test fixes to support new features that are now tested with worlds. For example generators inconsistently tested import/export/default interfaces and now the codegen test worlds all exercise all of these features.

This enables simplifying codegen tests as well by having each test
exercise imports/exports instead of having all code generators have one
case for imports and one for exports.
No longer needed as the name is inferred from the `*.wit` world.
Update all `runtime/*` tests with new naming conventions, world files,
etc. Minor updates were made to names as I ended up using different
conventions for the `*.wit` world files than were previously exercised.

This also fixes a few minor issues with the output for the JS generator
in the default ESM mode.
Various small updates here and there to namings and such.
Fix support for exported instances by using correct import paths for
various types/intrinsics/etc. Additionally update the codegen tests to
specify a mypy cache dir to avoid racing between tests.
Also fix an issue with the Rust host generator where it used an
interface's name instead of the name of the import for import module names.
Copy link
Copy Markdown
Contributor

@pchickey pchickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very much mechanical so I spot-checked and trust CI with the rest.

@alexcrichton alexcrichton merged commit 0220c95 into bytecodealliance:main Nov 15, 2022
@alexcrichton alexcrichton deleted the remove-interface-parse-file branch November 15, 2022 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants