diff options
author | Alon Zakai <azakai@google.com> | 2020-06-20 14:24:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-20 14:24:50 -0700 |
commit | 711f8cb0ccc0de434a86c6c704acd5a13848f4db (patch) | |
tree | 43e93ffb18c37a2e11ad46368f920992a38c239e /scripts/test/spectest.js | |
parent | dd4c07c77ee11a6f89651990ad66fd96776b58db (diff) | |
download | binaryen-711f8cb0ccc0de434a86c6c704acd5a13848f4db.tar.gz binaryen-711f8cb0ccc0de434a86c6c704acd5a13848f4db.tar.bz2 binaryen-711f8cb0ccc0de434a86c6c704acd5a13848f4db.zip |
wasm2js testing improvements before bulk-memory (#2918)
Necessary preparations for a later PR that adds bulk memory
support to wasm2js (splitting this out so the next PR is less big):
* Fix logging of print functions in wasm2js spec tests, there
was an extra space in the output (which console.log adds
automatically between items).
* Don't assume the output is always empty, as some tests
(like bulk memory) do have expected output.
* Rename test/bulk-memory.wast as it "conflicts" with
test/spec/bulk-memory.wast - the problem is that we scan
both places, and emit files in test/wasm2js/*, so those
would collide if the names overlap.
* Extend the parsing and emitting of JS for (assert.. ) lines such as
(assert_return (invoke "foo" (i32.const 1)) (i32.const 2))
to also handle
(invoke "foo" (i32.const 1)) (i32.const 2))
Without this, we skip (invoke ..) lines in spec tests, which normally is
fine, but in bulk memory at least they have side effects we need - we
must run them before the later assertions.
Diffstat (limited to 'scripts/test/spectest.js')
-rw-r--r-- | scripts/test/spectest.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/test/spectest.js b/scripts/test/spectest.js index 3c4bac1b5..ede13479e 100644 --- a/scripts/test/spectest.js +++ b/scripts/test/spectest.js @@ -2,19 +2,19 @@ export function print() { console.log(); } export function print_i32(arg) { - console.log(arg, ' : i32'); + console.log(arg, ': i32'); } export function print_f32(arg) { - console.log(arg, ' : f32'); + console.log(arg, ': f32'); } export function print_f64(arg) { - console.log(arg, ' : f64'); + console.log(arg, ': f64'); } export function print_i32_f32(arg0, arg1) { - console.log(arg0, ' : i32'); - console.log(arg1, ' : f32'); + console.log(arg0, ': i32'); + console.log(arg1, ': f32'); } export function print_f64_f64(arg0, arg1) { - console.log(arg0, ' : f64'); - console.log(arg1, ' : f64'); + console.log(arg0, ': f64'); + console.log(arg1, ': f64'); } |