summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/d8/assertreturn-complex-module.txt2
-rw-r--r--test/d8/assertreturn-failed.txt2
-rw-r--r--test/d8/assertreturn-invoke-ordering.txt2
-rw-r--r--test/d8/assertreturn-types.txt2
-rw-r--r--test/d8/assertreturn.txt2
-rw-r--r--test/d8/assertreturnnan.txt2
-rw-r--r--test/d8/basic.txt2
-rw-r--r--test/d8/binary.txt2
-rw-r--r--test/d8/br.txt2
-rw-r--r--test/d8/brif-loop.txt2
-rw-r--r--test/d8/brif.txt2
-rw-r--r--test/d8/brtable.txt2
-rw-r--r--test/d8/call.txt2
-rw-r--r--test/d8/callindirect.txt2
-rw-r--r--test/d8/cast.txt2
-rw-r--r--test/d8/compare.txt2
-rw-r--r--test/d8/convert.txt2
-rw-r--r--test/d8/empty.txt2
-rw-r--r--test/d8/export-multi.txt2
-rw-r--r--test/d8/expr-block.txt2
-rw-r--r--test/d8/expr-br.txt2
-rw-r--r--test/d8/expr-brif.txt2
-rw-r--r--test/d8/expr-if.txt2
-rw-r--r--test/d8/if.txt2
-rw-r--r--test/d8/import.txt2
-rw-r--r--test/d8/invoke.txt2
-rw-r--r--test/d8/load.txt2
-rw-r--r--test/d8/loop.txt2
-rw-r--r--test/d8/memory-empty-segment.txt2
-rw-r--r--test/d8/memory-export.txt2
-rw-r--r--test/d8/memory-no-export.txt2
-rw-r--r--test/d8/return-void.txt2
-rw-r--r--test/d8/return.txt2
-rw-r--r--test/d8/select.txt2
-rw-r--r--test/d8/start.txt2
-rw-r--r--test/d8/store.txt2
-rw-r--r--test/d8/unary.txt2
-rw-r--r--test/d8/unreachable.txt2
-rw-r--r--test/find_exe.py10
-rwxr-xr-xtest/run-js.py (renamed from test/run-d8.py)37
-rwxr-xr-xtest/run-tests.py24
-rw-r--r--test/spec.js13
-rw-r--r--test/spec/address.txt2
-rw-r--r--test/spec/block.txt2
-rw-r--r--test/spec/block_comments.txt2
-rw-r--r--test/spec/conversions.txt2
-rw-r--r--test/spec/endianness.txt2
-rw-r--r--test/spec/exports.txt2
-rw-r--r--test/spec/f32.txt2
-rw-r--r--test/spec/f32_cmp.txt2
-rw-r--r--test/spec/f64.txt2
-rw-r--r--test/spec/f64_cmp.txt2
-rw-r--r--test/spec/fac.txt2
-rw-r--r--test/spec/float_exprs.txt2
-rw-r--r--test/spec/float_literals.txt2
-rw-r--r--test/spec/float_memory.txt2
-rw-r--r--test/spec/float_misc.txt2
-rw-r--r--test/spec/forward.txt2
-rw-r--r--test/spec/func_ptrs.txt2
-rw-r--r--test/spec/functions.txt4
-rw-r--r--test/spec/i32.txt2
-rw-r--r--test/spec/i64.txt2
-rw-r--r--test/spec/imports.txt2
-rw-r--r--test/spec/int_exprs.txt2
-rw-r--r--test/spec/int_literals.txt2
-rw-r--r--test/spec/labels.txt2
-rw-r--r--test/spec/left-to-right.txt2
-rw-r--r--test/spec/memory.txt2
-rw-r--r--test/spec/memory_redundancy.txt2
-rw-r--r--test/spec/memory_trap.txt2
-rw-r--r--test/spec/names.txt2
-rw-r--r--test/spec/nan-propagation.txt2
-rw-r--r--test/spec/resizing.txt2
-rw-r--r--test/spec/runaway-recursion.txt2
-rw-r--r--test/spec/select.txt2
-rw-r--r--test/spec/start.txt2
-rw-r--r--test/spec/store_retval.txt2
-rw-r--r--test/spec/switch.txt2
-rw-r--r--test/spec/traps.txt2
-rw-r--r--test/spec/unreachable.txt2
-rw-r--r--test/wasm.js12
81 files changed, 145 insertions, 105 deletions
diff --git a/test/d8/assertreturn-complex-module.txt b/test/d8/assertreturn-complex-module.txt
index 3c0a9564..157a02af 100644
--- a/test/d8/assertreturn-complex-module.txt
+++ b/test/d8/assertreturn-complex-module.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
(module
(memory 1 (segment 0 "hello") (segment 20 "goodbye"))
(func $set_m (param i32) (i32.store (i32.const 32) (get_local 0)))
diff --git a/test/d8/assertreturn-failed.txt b/test/d8/assertreturn-failed.txt
index 219bec0d..4ec0d0a3 100644
--- a/test/d8/assertreturn-failed.txt
+++ b/test/d8/assertreturn-failed.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
(module
(func (param i32) (result i32)
(i32.add (get_local 0) (i32.const 1)))
diff --git a/test/d8/assertreturn-invoke-ordering.txt b/test/d8/assertreturn-invoke-ordering.txt
index 5c304c9e..90d1871a 100644
--- a/test/d8/assertreturn-invoke-ordering.txt
+++ b/test/d8/assertreturn-invoke-ordering.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
(module
(func (param i32) (result i32)
(i32.mul (get_local 0) (i32.const 2)))
diff --git a/test/d8/assertreturn-types.txt b/test/d8/assertreturn-types.txt
index 17ef2ad5..6df799f9 100644
--- a/test/d8/assertreturn-types.txt
+++ b/test/d8/assertreturn-types.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
(module
(func $i32 (param i32) (result i32)
(i32.add (get_local 0) (i32.const 1)))
diff --git a/test/d8/assertreturn.txt b/test/d8/assertreturn.txt
index d98cbee9..6296387a 100644
--- a/test/d8/assertreturn.txt
+++ b/test/d8/assertreturn.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
(module
(func (param i32) (result i32) (get_local 0))
(export "f" 0))
diff --git a/test/d8/assertreturnnan.txt b/test/d8/assertreturnnan.txt
index ea0e3482..4b717309 100644
--- a/test/d8/assertreturnnan.txt
+++ b/test/d8/assertreturnnan.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
(module
(func $f32 (result f32)
(f32.div (f32.const 0) (f32.const 0)))
diff --git a/test/d8/basic.txt b/test/d8/basic.txt
index 1d272cda..3e9c75ac 100644
--- a/test/d8/basic.txt
+++ b/test/d8/basic.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(func (result i32)
(return (i32.const 42)))
diff --git a/test/d8/binary.txt b/test/d8/binary.txt
index d9866c96..829c278f 100644
--- a/test/d8/binary.txt
+++ b/test/d8/binary.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
;; i32
(export "i32_add" $i32_add)
diff --git a/test/d8/br.txt b/test/d8/br.txt
index e391b9e1..76ede59f 100644
--- a/test/d8/br.txt
+++ b/test/d8/br.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
;; basic br test
(export "br0" $br0)
diff --git a/test/d8/brif-loop.txt b/test/d8/brif-loop.txt
index c6d411fb..830b9a1f 100644
--- a/test/d8/brif-loop.txt
+++ b/test/d8/brif-loop.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(func $f (param i32) (result i32)
(local i32)
diff --git a/test/d8/brif.txt b/test/d8/brif.txt
index 0eee085d..5af333c0 100644
--- a/test/d8/brif.txt
+++ b/test/d8/brif.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(func $f (param i32) (result i32)
(block $exit
diff --git a/test/d8/brtable.txt b/test/d8/brtable.txt
index 94e0c670..8ff88bf6 100644
--- a/test/d8/brtable.txt
+++ b/test/d8/brtable.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(func $f (param i32) (result i32)
(block $default
diff --git a/test/d8/call.txt b/test/d8/call.txt
index e67fa2f1..aa23f198 100644
--- a/test/d8/call.txt
+++ b/test/d8/call.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(export "call" $call)
(func $call (result i32)
diff --git a/test/d8/callindirect.txt b/test/d8/callindirect.txt
index 58d54d26..54ae2429 100644
--- a/test/d8/callindirect.txt
+++ b/test/d8/callindirect.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(type $v_i (func (result i32)))
(func $zero (type $v_i) (i32.const 0))
diff --git a/test/d8/cast.txt b/test/d8/cast.txt
index 8ccc4785..dfbb3612 100644
--- a/test/d8/cast.txt
+++ b/test/d8/cast.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(export "f32_reinterpret_i32" $f32_reinterpret_i32)
(func $f32_reinterpret_i32 (result f32)
diff --git a/test/d8/compare.txt b/test/d8/compare.txt
index 1d9fa9ad..4e897d5c 100644
--- a/test/d8/compare.txt
+++ b/test/d8/compare.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
;; i32
(export "i32_eq_true" $i32_eq_true)
diff --git a/test/d8/convert.txt b/test/d8/convert.txt
index 6b0a9c37..1e7490a7 100644
--- a/test/d8/convert.txt
+++ b/test/d8/convert.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
;; i32
(export "i32_wrap_i64" $i32_wrap_i64)
diff --git a/test/d8/empty.txt b/test/d8/empty.txt
index 22bc331d..5dd5a562 100644
--- a/test/d8/empty.txt
+++ b/test/d8/empty.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(export "f" 0)
(func))
diff --git a/test/d8/export-multi.txt b/test/d8/export-multi.txt
index 9e075966..1d93ee95 100644
--- a/test/d8/export-multi.txt
+++ b/test/d8/export-multi.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
(module
(func (result i32)
(i32.const 1))
diff --git a/test/d8/expr-block.txt b/test/d8/expr-block.txt
index e9c08b02..a5903c1a 100644
--- a/test/d8/expr-block.txt
+++ b/test/d8/expr-block.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(func $test (result i32)
(block
diff --git a/test/d8/expr-br.txt b/test/d8/expr-br.txt
index 90ed185b..b3beb7ce 100644
--- a/test/d8/expr-br.txt
+++ b/test/d8/expr-br.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(func $f (param i32) (result i32)
(block
diff --git a/test/d8/expr-brif.txt b/test/d8/expr-brif.txt
index 2bfc0bf2..08631be2 100644
--- a/test/d8/expr-brif.txt
+++ b/test/d8/expr-brif.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(func (param i32) (result i32)
(block $exit
diff --git a/test/d8/expr-if.txt b/test/d8/expr-if.txt
index 9376fac8..4370154e 100644
--- a/test/d8/expr-if.txt
+++ b/test/d8/expr-if.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(func (param i32) (result i32)
(if (i32.eq (get_local 0) (i32.const 0))
diff --git a/test/d8/if.txt b/test/d8/if.txt
index aac8aac5..91d7c4bd 100644
--- a/test/d8/if.txt
+++ b/test/d8/if.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(export "if1" $if1)
(func $if1 (result i32) (local i32)
diff --git a/test/d8/import.txt b/test/d8/import.txt
index 26c25c20..a93ace19 100644
--- a/test/d8/import.txt
+++ b/test/d8/import.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
;; stdio is ignored
(import $print_i32 "stdio" "print" (param i32))
diff --git a/test/d8/invoke.txt b/test/d8/invoke.txt
index 4498ce8a..02a21c7e 100644
--- a/test/d8/invoke.txt
+++ b/test/d8/invoke.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
(module
(func (param i32) (result i32) (get_local 0))
(export "f" 0))
diff --git a/test/d8/load.txt b/test/d8/load.txt
index 3c174bd9..8f1537a8 100644
--- a/test/d8/load.txt
+++ b/test/d8/load.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(memory 1
(segment 0 "\ff\ff\ff\ff")
diff --git a/test/d8/loop.txt b/test/d8/loop.txt
index 487910c4..794e8e1d 100644
--- a/test/d8/loop.txt
+++ b/test/d8/loop.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(export "loop" $loop)
(func $loop (result i32)
diff --git a/test/d8/memory-empty-segment.txt b/test/d8/memory-empty-segment.txt
index b2d8fcb0..c8dd1062 100644
--- a/test/d8/memory-empty-segment.txt
+++ b/test/d8/memory-empty-segment.txt
@@ -1,2 +1,2 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module (memory 1 (segment 0 "")))
diff --git a/test/d8/memory-export.txt b/test/d8/memory-export.txt
index bd2e4e41..b434c30c 100644
--- a/test/d8/memory-export.txt
+++ b/test/d8/memory-export.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(memory 100)
(export "memory" memory)
diff --git a/test/d8/memory-no-export.txt b/test/d8/memory-no-export.txt
index 45f4c032..985faf26 100644
--- a/test/d8/memory-no-export.txt
+++ b/test/d8/memory-no-export.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
;;; NOTE: broken in d8
(module
(memory 100)
diff --git a/test/d8/return-void.txt b/test/d8/return-void.txt
index 6bbe0dc6..6d40e134 100644
--- a/test/d8/return-void.txt
+++ b/test/d8/return-void.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(memory 1)
(func $store_unless (param i32)
diff --git a/test/d8/return.txt b/test/d8/return.txt
index e21ee670..e3973966 100644
--- a/test/d8/return.txt
+++ b/test/d8/return.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(func $f (param i32) (result i32)
(if (i32.eq (get_local 0) (i32.const 0))
diff --git a/test/d8/select.txt b/test/d8/select.txt
index bcfc9870..0ba6a758 100644
--- a/test/d8/select.txt
+++ b/test/d8/select.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(func $i32 (param i32) (result i32)
(select (i32.const 1) (i32.const 2) (get_local 0)))
diff --git a/test/d8/start.txt b/test/d8/start.txt
index 5b9a523f..e7c74b59 100644
--- a/test/d8/start.txt
+++ b/test/d8/start.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(memory 1)
(func $start (i32.store (i32.const 0) (i32.const 42)))
diff --git a/test/d8/store.txt b/test/d8/store.txt
index 1197e04a..cb0389e8 100644
--- a/test/d8/store.txt
+++ b/test/d8/store.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(memory 1)
diff --git a/test/d8/unary.txt b/test/d8/unary.txt
index 97b05b7f..8d0963b1 100644
--- a/test/d8/unary.txt
+++ b/test/d8/unary.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
;; i32
(export "i32_eqz_100" $i32_eqz_100)
diff --git a/test/d8/unreachable.txt b/test/d8/unreachable.txt
index 5b56db3c..6bff9a3d 100644
--- a/test/d8/unreachable.txt
+++ b/test/d8/unreachable.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8
+;;; TOOL: run-js
(module
(export "trap" 0)
(func
diff --git a/test/find_exe.py b/test/find_exe.py
index 4ef2b9db..0e73c841 100644
--- a/test/find_exe.py
+++ b/test/find_exe.py
@@ -27,6 +27,9 @@ DEFAULT_SEXPR_WASM_EXE = os.path.join(REPO_ROOT_DIR, 'out', 'sexpr-wasm')
BUILT_D8_EXE = os.path.join(REPO_ROOT_DIR, 'third_party', 'v8', 'v8', 'out',
'Release', 'd8')
DOWNLOAD_D8_EXE = os.path.join(REPO_ROOT_DIR, 'out', 'd8')
+BUILT_SM_EXE = os.path.join(REPO_ROOT_DIR, 'third_party', 'gecko-dev', 'js',
+ 'src', 'build_OPT.OBJ', 'js', 'src', 'js')
+DOWNLOAD_SM_EXE = os.path.join(REPO_ROOT_DIR, 'out', 'js')
DEFAULT_WASM_WAST_EXE = os.path.join(REPO_ROOT_DIR, 'out', 'wasm-wast')
DEFAULT_WASM_INTERP_EXE = os.path.join(REPO_ROOT_DIR, 'out', 'wasm-interp')
@@ -35,6 +38,8 @@ if IS_WINDOWS:
DEFAULT_SEXPR_WASM_EXE += '.exe'
BUILT_D8_EXE += '.exe'
DOWNLOAD_D8_EXE += '.exe'
+ BUILT_SM_EXE += '.exe'
+ DOWNLOAD_SM_EXE += '.exe'
DEFAULT_WASM_WAST_EXE += '.exe'
DEFAULT_WASM_INTERP_EXE += '.exe'
@@ -67,5 +72,6 @@ def GetWasmInterpExecutable(override=None):
return FindExeWithFallback('wasm-interp', [DEFAULT_WASM_INTERP_EXE], override)
-def GetD8Executable(override=None):
- return FindExeWithFallback('d8', [BUILT_D8_EXE, DOWNLOAD_D8_EXE], override)
+def GetJSExecutable(override=None):
+ return FindExeWithFallback('js',
+ [BUILT_D8_EXE, BUILT_SM_EXE, DOWNLOAD_D8_EXE, DOWNLOAD_SM_EXE], override)
diff --git a/test/run-d8.py b/test/run-js.py
index 9444b41b..612d71df 100755
--- a/test/run-d8.py
+++ b/test/run-js.py
@@ -28,7 +28,6 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
WASM_JS = os.path.join(SCRIPT_DIR, 'wasm.js')
SPEC_JS = os.path.join(SCRIPT_DIR, 'spec.js')
-
def CleanD8Stdout(stdout):
def FixLine(line):
idx = line.find('WasmModule::Instantiate()')
@@ -46,14 +45,36 @@ def CleanD8Stderr(stderr):
return stderr.strip()
+def GetExeBasename(exe):
+ return os.path.basename(exe)
+
+
+def GetJSExecutable(options):
+ exe = find_exe.GetJSExecutable(options.js_executable)
+ if GetExeBasename(exe) == 'd8':
+ return utils.Executable(exe,
+ clean_stdout=CleanD8Stdout,
+ clean_stderr=CleanD8Stderr,
+ error_cmdline=options.error_cmdline)
+ else:
+ return utils.Executable(exe, error_cmdline=options.error_cmdline)
+
+
+def RunJS(js, js_file, out_file):
+ if GetExeBasename(js.exe) == 'd8':
+ js.RunWithArgs('--expose-wasm', js_file, '--', out_file)
+ else:
+ js.RunWithArgs(js_file, out_file)
+
+
def main(args):
parser = argparse.ArgumentParser()
parser.add_argument('-o', '--out-dir', metavar='PATH',
help='output directory for files.')
parser.add_argument('-e', '--executable', metavar='PATH',
help='override sexpr-wasm executable.')
- parser.add_argument('--d8-executable', metavar='PATH',
- help='override d8 executable.')
+ parser.add_argument('--js-executable', metavar='PATH',
+ help='override js executable.')
parser.add_argument('-v', '--verbose', help='print more diagnotic messages.',
action='store_true')
parser.add_argument('--no-error-cmdline',
@@ -74,18 +95,14 @@ def main(args):
'--use-libc-allocator': options.use_libc_allocator
})
- d8 = utils.Executable(find_exe.GetD8Executable(options.d8_executable),
- clean_stdout=CleanD8Stdout,
- clean_stderr=CleanD8Stderr,
- error_cmdline=options.error_cmdline)
-
- with utils.TempDirectory(options.out_dir, 'run-d8-') as out_dir:
+ js = GetJSExecutable(options)
+ with utils.TempDirectory(options.out_dir, 'run-js-') as out_dir:
new_ext = '.json' if options.spec else '.wasm'
out_file = utils.ChangeDir(utils.ChangeExt(options.file, new_ext), out_dir)
sexpr_wasm.RunWithArgs(options.file, '-o', out_file)
js_file = SPEC_JS if options.spec else WASM_JS
- d8.RunWithArgs('--expose-wasm', js_file, '--', out_file)
+ RunJS(js, js_file, out_file)
return 0
diff --git a/test/run-tests.py b/test/run-tests.py
index d65713e8..04ff4d2f 100755
--- a/test/run-tests.py
+++ b/test/run-tests.py
@@ -48,19 +48,19 @@ TOOLS = {
'sexpr-wasm': {
'EXE': '%(sexpr-wasm)s'
},
- 'run-d8': {
- 'EXE': 'test/run-d8.py',
+ 'run-js': {
+ 'EXE': 'test/run-js.py',
'FLAGS': ' '.join([
'-e', '%(sexpr-wasm)s',
- '--d8-executable=%(d8)s',
+ '--js-executable=%(js)s',
'--no-error-cmdline',
])
},
- 'run-d8-spec': {
- 'EXE': 'test/run-d8.py',
+ 'run-js-spec': {
+ 'EXE': 'test/run-js.py',
'FLAGS': ' '.join([
'-e', '%(sexpr-wasm)s',
- '--d8-executable=%(d8)s',
+ '--js-executable=%(js)s',
'--spec',
'--no-error-cmdline',
])
@@ -101,7 +101,7 @@ TOOLS = {
}
}
-ROUNDTRIP_TOOLS = ('sexpr-wasm', 'run-d8')
+ROUNDTRIP_TOOLS = ('sexpr-wasm', 'run-js')
def Indent(s, spaces):
@@ -517,8 +517,8 @@ def main(args):
'flags.')
parser.add_argument('-e', '--sexpr-wasm-executable', metavar='PATH',
help='override executable.')
- parser.add_argument('--d8-executable', metavar='PATH',
- help='override d8 executable.')
+ parser.add_argument('--js-executable', metavar='PATH',
+ help='override js executable.')
parser.add_argument('--wasm-wast-executable', metavar='PATH',
help='override wasm-wast executable.')
parser.add_argument('--wasm-interp-executable', metavar='PATH',
@@ -571,10 +571,8 @@ def main(args):
variables = {
'sexpr-wasm':
find_exe.GetSexprWasmExecutable(options.sexpr_wasm_executable),
- 'd8':
- find_exe.GetD8Executable(options.d8_executable),
- 'wasm-wast':
- find_exe.GetWasmWastExecutable(options.wasm_wast_executable),
+ 'js': find_exe.GetJSExecutable(options.js_executable),
+ 'wasm-wast': find_exe.GetWasmWastExecutable(options.wasm_wast_executable),
'wasm-interp':
find_exe.GetWasmInterpExecutable(options.wasm_interp_executable),
}
diff --git a/test/spec.js b/test/spec.js
index e6a4e7b1..68e56332 100644
--- a/test/spec.js
+++ b/test/spec.js
@@ -14,8 +14,17 @@
* limitations under the License.
*/
+/* polyfill from SM to D8 */
+if (typeof arguments == 'undefined') {
+ arguments = scriptArgs;
+}
+
+if (typeof readbuffer == 'undefined') {
+ readbuffer = function(path) { return read(path, 'binary'); };
+}
+
if (arguments.length != 1) {
- print('usage: d8 spec.js -- <filename.json>');
+ print('usage: <exe> spec.js -- <filename.json>');
quit(0);
}
@@ -64,7 +73,7 @@ function createModule(a) {
var memory = null;
var u8a = new Uint8Array(a);
var ffi = {spectest: {print: print}};
- var module = Wasm.instantiateModule(u8a.buffer, ffi);
+ var module = Wasm.instantiateModule(u8a, ffi);
memory = module.memory;
return module;
}
diff --git a/test/spec/address.txt b/test/spec/address.txt
index 9d0ab6c2..8b169c4d 100644
--- a/test/spec/address.txt
+++ b/test/spec/address.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/address.wast
(;; STDOUT ;;;
assert_invalid error:
diff --git a/test/spec/block.txt b/test/spec/block.txt
index cc2bc2af..dbf4279b 100644
--- a/test/spec/block.txt
+++ b/test/spec/block.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/block.wast
(;; STDOUT ;;;
$invoke_0 = undefined
diff --git a/test/spec/block_comments.txt b/test/spec/block_comments.txt
index a3af4163..df8cfa00 100644
--- a/test/spec/block_comments.txt
+++ b/test/spec/block_comments.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/block_comments.wast
(;; STDOUT ;;;
0/0 tests passed.
diff --git a/test/spec/conversions.txt b/test/spec/conversions.txt
index aa13e0c1..f8e54660 100644
--- a/test/spec/conversions.txt
+++ b/test/spec/conversions.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/conversions.wast
(;; STDOUT ;;;
318/318 tests passed.
diff --git a/test/spec/endianness.txt b/test/spec/endianness.txt
index c81bcd34..7fec6f88 100644
--- a/test/spec/endianness.txt
+++ b/test/spec/endianness.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/endianness.wast
(;; STDOUT ;;;
68/68 tests passed.
diff --git a/test/spec/exports.txt b/test/spec/exports.txt
index f799cb5e..8b822f91 100644
--- a/test/spec/exports.txt
+++ b/test/spec/exports.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/exports.wast
(;; STDOUT ;;;
assert_invalid error:
diff --git a/test/spec/f32.txt b/test/spec/f32.txt
index 58aa5481..ac011ba5 100644
--- a/test/spec/f32.txt
+++ b/test/spec/f32.txt
@@ -1,5 +1,5 @@
;;; SLOW:
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/f32.wast
(;; STDOUT ;;;
2394/2394 tests passed.
diff --git a/test/spec/f32_cmp.txt b/test/spec/f32_cmp.txt
index 1607b68d..f7e95095 100644
--- a/test/spec/f32_cmp.txt
+++ b/test/spec/f32_cmp.txt
@@ -1,5 +1,5 @@
;;; SLOW:
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/f32_cmp.wast
(;; STDOUT ;;;
1944/1944 tests passed.
diff --git a/test/spec/f64.txt b/test/spec/f64.txt
index eb56653d..6c30966e 100644
--- a/test/spec/f64.txt
+++ b/test/spec/f64.txt
@@ -1,5 +1,5 @@
;;; SLOW:
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/f64.wast
(;; STDOUT ;;;
2394/2394 tests passed.
diff --git a/test/spec/f64_cmp.txt b/test/spec/f64_cmp.txt
index 60f4daab..a7529c8a 100644
--- a/test/spec/f64_cmp.txt
+++ b/test/spec/f64_cmp.txt
@@ -1,5 +1,5 @@
;;; SLOW:
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/f64_cmp.wast
(;; STDOUT ;;;
1944/1944 tests passed.
diff --git a/test/spec/fac.txt b/test/spec/fac.txt
index a6b5541f..6f5cd7db 100644
--- a/test/spec/fac.txt
+++ b/test/spec/fac.txt
@@ -1,3 +1,3 @@
;;; SKIP: running via `make test` still locks machine
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/fac.wast
diff --git a/test/spec/float_exprs.txt b/test/spec/float_exprs.txt
index 0db0522d..7aef6047 100644
--- a/test/spec/float_exprs.txt
+++ b/test/spec/float_exprs.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/float_exprs.wast
(;; STDOUT ;;;
third_party/testsuite/float_exprs.wast:153: $assert_return_0 failed.
diff --git a/test/spec/float_literals.txt b/test/spec/float_literals.txt
index cf03c00f..1a9df363 100644
--- a/test/spec/float_literals.txt
+++ b/test/spec/float_literals.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/float_literals.wast
(;; STDOUT ;;;
60/60 tests passed.
diff --git a/test/spec/float_memory.txt b/test/spec/float_memory.txt
index 8a21ac52..03d5f5a4 100644
--- a/test/spec/float_memory.txt
+++ b/test/spec/float_memory.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/float_memory.wast
(;; STDOUT ;;;
$invoke_2 = undefined
diff --git a/test/spec/float_misc.txt b/test/spec/float_misc.txt
index 51dfbff8..924ea3c4 100644
--- a/test/spec/float_misc.txt
+++ b/test/spec/float_misc.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/float_misc.wast
(;; STDOUT ;;;
323/323 tests passed.
diff --git a/test/spec/forward.txt b/test/spec/forward.txt
index 64da321c..bb70073d 100644
--- a/test/spec/forward.txt
+++ b/test/spec/forward.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/forward.wast
(;; STDOUT ;;;
4/4 tests passed.
diff --git a/test/spec/func_ptrs.txt b/test/spec/func_ptrs.txt
index 66ee5989..c2ad7778 100644
--- a/test/spec/func_ptrs.txt
+++ b/test/spec/func_ptrs.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/func_ptrs.wast
(;; STDOUT ;;;
assert_invalid error:
diff --git a/test/spec/functions.txt b/test/spec/functions.txt
index fcb56cfb..e916b5e4 100644
--- a/test/spec/functions.txt
+++ b/test/spec/functions.txt
@@ -1,5 +1,5 @@
;;; ERROR: 1
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/functions.wast
(;; STDERR ;;;
Error running "d8":
@@ -8,7 +8,7 @@ Error running "d8":
(;; STDOUT ;;;
WasmModule::Instantiate(): Compiling WASM function #6:<?> failed:Result = arity mismatch in return @+2
- var module = Wasm.instantiateModule(u8a.buffer, ffi);
+ var module = Wasm.instantiateModule(u8a, ffi);
^
;;; STDOUT ;;)
diff --git a/test/spec/i32.txt b/test/spec/i32.txt
index b2f2c8a7..7728686d 100644
--- a/test/spec/i32.txt
+++ b/test/spec/i32.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/i32.wast
(;; STDOUT ;;;
326/326 tests passed.
diff --git a/test/spec/i64.txt b/test/spec/i64.txt
index e7d80688..29e14d25 100644
--- a/test/spec/i64.txt
+++ b/test/spec/i64.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/i64.wast
(;; STDOUT ;;;
328/328 tests passed.
diff --git a/test/spec/imports.txt b/test/spec/imports.txt
index c90ac55a..ceb68b26 100644
--- a/test/spec/imports.txt
+++ b/test/spec/imports.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/imports.wast
(;; STDOUT ;;;
14 42
diff --git a/test/spec/int_exprs.txt b/test/spec/int_exprs.txt
index ae1e6f53..c258c2f9 100644
--- a/test/spec/int_exprs.txt
+++ b/test/spec/int_exprs.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/int_exprs.wast
(;; STDOUT ;;;
75/75 tests passed.
diff --git a/test/spec/int_literals.txt b/test/spec/int_literals.txt
index 7494225d..7af9bdbb 100644
--- a/test/spec/int_literals.txt
+++ b/test/spec/int_literals.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/int_literals.wast
(;; STDOUT ;;;
18/18 tests passed.
diff --git a/test/spec/labels.txt b/test/spec/labels.txt
index 172e5cc6..decf679d 100644
--- a/test/spec/labels.txt
+++ b/test/spec/labels.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/labels.wast
(;; STDOUT ;;;
assert_invalid error:
diff --git a/test/spec/left-to-right.txt b/test/spec/left-to-right.txt
index 175908bb..f4438101 100644
--- a/test/spec/left-to-right.txt
+++ b/test/spec/left-to-right.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/left-to-right.wast
(;; STDOUT ;;;
95/95 tests passed.
diff --git a/test/spec/memory.txt b/test/spec/memory.txt
index d4ddf504..5ae416d1 100644
--- a/test/spec/memory.txt
+++ b/test/spec/memory.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/memory.wast
(;; STDOUT ;;;
assert_invalid error:
diff --git a/test/spec/memory_redundancy.txt b/test/spec/memory_redundancy.txt
index 476d6aff..0abcd161 100644
--- a/test/spec/memory_redundancy.txt
+++ b/test/spec/memory_redundancy.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/memory_redundancy.wast
(;; STDOUT ;;;
$invoke_1 = undefined
diff --git a/test/spec/memory_trap.txt b/test/spec/memory_trap.txt
index d6ac0fef..61507c67 100644
--- a/test/spec/memory_trap.txt
+++ b/test/spec/memory_trap.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/memory_trap.wast
(;; STDOUT ;;;
third_party/testsuite/memory_trap.wast:24: $assert_return_0 unexpectedly threw: Error: memory access out of bounds
diff --git a/test/spec/names.txt b/test/spec/names.txt
index b5ae7984..e57035a1 100644
--- a/test/spec/names.txt
+++ b/test/spec/names.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/names.wast
(;; STDOUT ;;;
42
diff --git a/test/spec/nan-propagation.txt b/test/spec/nan-propagation.txt
index 7e15803e..322dd6a1 100644
--- a/test/spec/nan-propagation.txt
+++ b/test/spec/nan-propagation.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/nan-propagation.wast
(;; STDOUT ;;;
110/110 tests passed.
diff --git a/test/spec/resizing.txt b/test/spec/resizing.txt
index 6d0cab8e..c7222058 100644
--- a/test/spec/resizing.txt
+++ b/test/spec/resizing.txt
@@ -1,3 +1,3 @@
;;; SKIP: v8-native throws memory access out of bounds
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/resizing.wast
diff --git a/test/spec/runaway-recursion.txt b/test/spec/runaway-recursion.txt
index 21499243..b7c0a71f 100644
--- a/test/spec/runaway-recursion.txt
+++ b/test/spec/runaway-recursion.txt
@@ -1,3 +1,3 @@
;;; SKIP: running via `make test` still locks machine
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/runaway-recursion.wast
diff --git a/test/spec/select.txt b/test/spec/select.txt
index dc9be41f..cd9d3d82 100644
--- a/test/spec/select.txt
+++ b/test/spec/select.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/select.wast
(;; STDOUT ;;;
28/28 tests passed.
diff --git a/test/spec/start.txt b/test/spec/start.txt
index 2f4aafc3..d22a3651 100644
--- a/test/spec/start.txt
+++ b/test/spec/start.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/start.wast
(;; STDOUT ;;;
assert_invalid error:
diff --git a/test/spec/store_retval.txt b/test/spec/store_retval.txt
index c55c94d7..29d1d36b 100644
--- a/test/spec/store_retval.txt
+++ b/test/spec/store_retval.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/store_retval.wast
(;; STDOUT ;;;
assert_invalid error:
diff --git a/test/spec/switch.txt b/test/spec/switch.txt
index 2e7c0334..f1320a72 100644
--- a/test/spec/switch.txt
+++ b/test/spec/switch.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/switch.wast
(;; STDOUT ;;;
assert_invalid error:
diff --git a/test/spec/traps.txt b/test/spec/traps.txt
index 78b1253c..114d4738 100644
--- a/test/spec/traps.txt
+++ b/test/spec/traps.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/traps.wast
(;; STDOUT ;;;
20/20 tests passed.
diff --git a/test/spec/unreachable.txt b/test/spec/unreachable.txt
index 47eabd88..45673ce1 100644
--- a/test/spec/unreachable.txt
+++ b/test/spec/unreachable.txt
@@ -1,4 +1,4 @@
-;;; TOOL: run-d8-spec
+;;; TOOL: run-js-spec
;;; STDIN_FILE: third_party/testsuite/unreachable.wast
(;; STDOUT ;;;
8/8 tests passed.
diff --git a/test/wasm.js b/test/wasm.js
index 5f996f50..6f208ef6 100644
--- a/test/wasm.js
+++ b/test/wasm.js
@@ -14,8 +14,18 @@
* limitations under the License.
*/
+/* polyfill from SM to D8 */
+if (typeof arguments == 'undefined') {
+ arguments = scriptArgs;
+}
+
+if (typeof readbuffer == 'undefined') {
+ readbuffer = function(path) { return read(path, 'binary'); };
+}
+
if (arguments.length != 1) {
- print('usage: d8 wasm.js -- <filename>');
+ print('usage: <exe> wasm.js -- <filename.wasm>');
+ print('got: ', arguments);
quit(0);
}