summaryrefslogtreecommitdiff
path: root/scripts/test/wasm2asm.py
Commit message (Collapse)AuthorAgeFilesLines
* Rename `wasm2asm` to `wasm2js`, emit ESM by default (#1642)Alex Crichton2018-08-301-110/+0
| | | | | | | | | | | | | | | | | | | | | | | | * Rename the `wasm2asm` tool to `wasm2js` This commit performs a relatively simple rename of the `wasm2asm` tool to `wasm2js`. The functionality of the tool doesn't change just yet but it's intended that we'll start generating an ES module instead of just an `asm.js` function soon. * wasm2js: Support `*.wasm` input files Previously `wasm2js` only supported `*.wast` files but to make it a bit easier to use in tooling pipelines this commit adds support for reading in a `*.wasm` file directly. Determining which parser to use depends on the input filename, where the binary parser is used with `*.wasm` files and the wast parser is used for all other files. * wasm2js: Emit ESM imports/exports by default This commit alters the default behavior of `wasm2js` to emit an ESM by default, either importing items from the environment or exporting. Items like initialization of memory are also handled here.
* Cleanup scripts in scripts/test (#1566)Sam Clegg2018-05-251-1/+15
| | | | | | | | | | Remove executable bit and #! from scripts that don't have entry point. Add missing licence test. Move arg parsing into a function. Remove legacy --only_prepare (with underscrore) argument.
* Clean up wasm2asm testing (#1546)Alon Zakai2018-05-131-5/+5
| | | | | * Move wasm2asm test outputs into their natural location, test/wasm2asm/ * Let people create new tests in there that ./auto_update_tests.py will auto-generate outputs for, just like all the other tests.
* include the filename in erroneous diff output where possible (#1452)Nathan Froyd2018-03-191-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Failing test cases often start out with: ``` incorrect output, diff: --- expected +++ actual ``` which makes it difficult to figure out where the expected output might live. That information can be derived from examining the tests, of course, but it'd be much nicer if it were provided in the diff to see straightaway. We do this by introducing a new check, one which takes a filename of expected output, which then enables us to display the failing file, e.g.: ``` incorrect output, diff: --- /home/froydnj/src/binaryen.git/test/passes/code-folding.txt +++ actual ``` which is arguably nicer. Having this new check also enables reducing some boilerplate `open(...).read()` calls in various places. There are still a few places using `fail_if_not_identical`, usually because `.strip()` is used on the expected output.
* wasm2asm fixes (#1436)Alon Zakai2018-02-201-8/+10
| | | | | | * don't look for asm.js compilation message if almost asm * fix wasm2asm f32 operations
* adjust test scripts to cope with out-of-tree builds (#1420)Nathan Froyd2018-02-141-11/+15
| | | | | | Many places assume that test/blah is valid, but that's only valid if you're executing scripts from the binaryen source directory. The binaryen_test option is more general, and enables out-of-tree testing, so that's what we should be using instead.
* i64 to i32 lowering for wasm2asm (#1134)Thomas Lively2017-09-011-5/+7
|
* wasm2asm test generation (#1124)Thomas Lively2017-08-161-10/+49
| | | | | | | | | | | | | | | | | * Translate assert_return invokes to asm * Translate assert_trap tests to JS * Enable wasm2asm tests * Fix wasm2asm translation of store * Update ubuntu nodejs in Travis * Free JSPrinter buffer * Use unique_ptr for Functions to prevent leaks * Add tests for assert translation
* Get wasm2asm building again (#1107)Thomas Lively2017-08-021-0/+51
* Get wasm2asm building again Updates CMakeLists.txt to have wasm2asm built by default, updates wasm2asm.h to account for recent interface changes, and restores JSPrinter functionality. * Implement splice for array values * Clean up wasm2asm testing * Print semicolons after statements in blocks * Cleanups and semicolons for condition arms * Prettify semicolon emission