-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support dart2wasm in node.js tests (#2259)
Support `dart2wasm` as a compiler for tests running in Node.js. `dart2wasm` emits a `.mjs` file exporting definitions to load generated wasm modules, the only additional thing we have to do is wrap that in a simple entrypoint file compiling the wasm module and invoking the startup wrapper. There's no support for stack trace maps yet. We also don't support precompiled node wasm tests yet (`dart2wasm` is also not currently supported by `build_web_compilers`, so we're blocked on that either way). In the test runtime, I had to migrate off `require` as that function is not in the global context for `.mjs` files. It looks like we can use `await import` instead though. If we need to support ancient Node versions that lack `import` support, I can adapt that to still use `require` when compiled with `dart2js` for compatibility.
- Loading branch information
Showing
20 changed files
with
356 additions
and
151 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: regression_tests | ||
publish_to: none | ||
environment: | ||
sdk: ^3.5.0-259.0.dev | ||
sdk: ^3.5.0-311.0.dev | ||
resolution: workspace | ||
dependencies: | ||
test: any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
platforms: [chrome, firefox] | ||
# Node doesn't work because the version available in the current Ubuntu GitHub runners is too | ||
# old to support WASM+GC, which would be required to run Dart tests. | ||
#platforms: [chrome, firefox, node] | ||
compilers: [dart2wasm] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: wasm_tests | ||
publish_to: none | ||
environment: | ||
sdk: ^3.5.0-259.0.dev | ||
sdk: ^3.5.0-311.0.dev | ||
resolution: workspace | ||
dev_dependencies: | ||
test: any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.