From 711f8cb0ccc0de434a86c6c704acd5a13848f4db Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 20 Jun 2020 14:24:50 -0700 Subject: 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. --- scripts/test/spectest.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts/test/spectest.js') 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'); } -- cgit v1.2.3