summaryrefslogtreecommitdiff
path: root/test/gen-spec-js.py
Commit message (Collapse)AuthorAgeFilesLines
* Finish instruction renaming (#1792)Heejin Ahn2021-12-201-3/+3
| | | | | | | | | | | | | This finishes #985. This - replaces the old names in the tests with the new names - drops support for the deprecated names - renames test files to match new instruction names I don't think dropping support for the old names will be a problem at this point. #985 says the old names are supported for convenience but we should remove those too at some point; that "some point" may have well arrived given that three years have passed. The lists of names updated are in #933, #1564, WebAssembly/spec#720.
* Remove support for python2 (#1321)Sam Clegg2020-01-311-6/+3
|
* Update testsuite (#1275)Sam Clegg2020-01-091-38/+26
| | | | | | | | | | | | | | | | | The two primary changes involved are: 1. Removal of `assert_return_canonical_nan`/`arithetic nan` in favor of special `nan:canonical`/`nan:arithmetic` constants that can only be used in test expectations. See: https://github.com/WebAssembly/spec/pull/1104 2. New trapping behaviour for bulk memory operations. Range checks are now performed up front for opterations such as memory.fill and memory.copy. See: https://github.com/webassembly/bulk-memory-operations/issues/111 And: https://github.com/webassembly/bulk-memory-operations/pull/123 The old behaviour is still kept around to support table.fill which is defined in reference-types proposal and has yet to be updated.
* Avoid os.path.relpath in gen-spec-js.py (#1246)Sam Clegg2019-11-211-3/+4
| | | | | | | | | relpath here was failing with on windows when TMPDIR is on a different drive. This is because `new_module_filename` lives in the TMPDIR where and json_dir might be on different drive. These paths don't get embedded in the final JS anyway because we embed them directly binary strings so its not important that they are relative.
* Switch python indentation from 2-space to 4-space (#1145)Sam Clegg2019-08-151-451/+451
| | | | | | | | pep8 specifies 4 space indentation. The use of 2 spaces is, I believe, a historical anomaly where certain large organizations such as google chose 2 over 4 and have yet to make the switch. For a project like wabt with little python code I think the cost of switching is small enough to justify the churn.
* Run flake8 on the whole repository (#1144)Guanzhong Chen2019-08-151-5/+4
|
* Update output of gen-spec-js to match spec (#654)Ben Smith2017-10-141-16/+29
| | | | | | * Use "call" and "get" helpers instead of accessing exports directly * Don't use `$$` for the most recent instance, instead always use a numbered instance (e.g. `$3`) * Add comments before each command with file and line number
* Rename wast2wasm -> wat2wasm, wast2json (#617)Ben Smith2017-09-081-26/+26
| | | | * wat2wasm only parses wat files (individual modules) * wast2json parses spec test files and generates json + wasm
* Rename wasm2wast -> wasm2wat (#616)Ben Smith2017-09-081-10/+10
| | | See issue #543.
* Update testsuite; more lexer/parser changes (#484)Ben Smith2017-06-111-2/+4
| | | | | | | | | | | | | | | | | | | | * Add support for quoted modules: `(module quote "...")` * Binary modules must be annotated: `(module binary "...")` * Multiple result blocks are no longer a parser error: `(func (result i32) (result i32) ...)` * Function types can specify unused bind variables: `(type (func (param $foo)))` * Rename `RawModule` -> `ScriptModule`. This encapsulates a module that may not be parsed yet, whether binary or "quoted". * Validate load/store offsets and alignment in the parser, not in the validator. The spec tests assume that you can catch these errors with `assert_malformed`. * Parse wast files in `wasm-interp` when checking malformed/invalid/etc. modules. This allows us to run all assertions at the same time, which is nice. `wasm-interp` should probably be renamed, though. * Two tests in `type.wast` fail because they use: `(assert_invalid (module quote "..."))`. I'd prefer that we don't support this, since it's unnecessary, and additional work. I'll fix in a follow-up CL if we decide this is worth keeping.
* Support arithmetic/canonical NaN; update testsuite (#368)Ben Smith2017-03-241-22/+61
| | | | | | | | | | | | | | | Positive NaN (+nan) is defined as being a NaN value where the sign bit is clear, the exponent is all ones, and the tag has only the "quiet" bit set. The quiet bit is the most-significant bit of the tag. For example, for a 32-bit float, +nan is 0x7cf00000. "Canonical NaN" is either +nan or -nan, where -nan is +nan with the sign bit set. "Arithmetic NaN" is defined as any other quiet NaN (i.e. the quiet bit must be set, but any other bit can be either 0 or 1.) This change doesn't update the interpreter because it is only a loosening of the previous NaN behavior.
* Update gen-spec-js to support assert_exhaustion (#313)Ben Smith2017-02-271-5/+4
|
* Add support for yapf python formatting tool (#276)Sam Clegg2017-01-181-31/+53
| | | | | | | | | | | | | | * Add support for yapf python formatting tool This changs adds .style.yapf to define the python style we are using. I also ran yapf over all the python files: $ yapf -i `git ls-files *.py` Going forward, we should probably add a travis test to prevent regressions. We should probably also switch to more conventional 4-space indentation, which is used by almost everybody outside of Google.
* Pass --bindir to test helpers rather than full path to each tool (#273)Sam Clegg2017-01-121-7/+6
| | | This simplifies the invocations and aids maintainability.
* Update test/run-tests.py (#255)Ben Smith2017-01-051-1/+1
| | | | | * Write all intermediate output to out/ * Use real paths for all test names (i.e. include "test/") * A few Python3 fixes
* clang-format, and python3 support in gen-spec-js.pyBen Smith2016-12-101-17/+14
|
* Fix gen-spec-js.pyBen Smith2016-12-051-157/+449
| | | | This now (mostly) matches the output from the spec interpreter.
* Fix error message in the generated invoke function (#97)gahaas2016-08-231-1/+3
| | | The error message wanted to print some file name and line number, but these values are not passed to invoke(). Additionally I propose to increase the passed and failed counters in invoke.
* update gen-spec-js.py to work with spidermonkeyBen Smith2016-05-101-1/+1
| | | | | spidermonkey requires the first argument to WASM.instantiateModule be a TypedArray, not an ArrayBuffer.
* add gen-spec-js.py; generates a standalone js testBen Smith2016-04-261-0/+200