summaryrefslogtreecommitdiff
path: root/test/run-interp.py
diff options
context:
space:
mode:
authorBen Smith <binjimin@gmail.com>2017-10-03 10:28:34 -0700
committerGitHub <noreply@github.com>2017-10-03 10:28:34 -0700
commit0e08c4974e614e05ecb72f25df07c04ff02b1ad0 (patch)
treebd52ec46e8aff4140935205b349c1889d0d04108 /test/run-interp.py
parentb10a3ab9187003f9e8ba84ef714821227981e77b (diff)
downloadwabt-0e08c4974e614e05ecb72f25df07c04ff02b1ad0.tar.gz
wabt-0e08c4974e614e05ecb72f25df07c04ff02b1ad0.tar.bz2
wabt-0e08c4974e614e05ecb72f25df07c04ff02b1ad0.zip
Add spectest-interp tool; split from wasm-interp (#643)
* `wasm-interp` tool now only runs `.wasm` file, not spec tests * `wasm-interp` has a new flag `--host-print` for importing a print function named "host.print" * `spectest-interp` tool runs only `.json` files
Diffstat (limited to 'test/run-interp.py')
-rwxr-xr-xtest/run-interp.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/test/run-interp.py b/test/run-interp.py
index 664a6d87..b40c7c10 100755
--- a/test/run-interp.py
+++ b/test/run-interp.py
@@ -44,6 +44,7 @@ def main(args):
help='print the commands that are run.',
action='store_true')
parser.add_argument('--run-all-exports', action='store_true')
+ parser.add_argument('--host-print', action='store_true')
parser.add_argument('--spec', action='store_true')
parser.add_argument('-t', '--trace', action='store_true')
parser.add_argument('file', help='test file.')
@@ -52,14 +53,25 @@ def main(args):
options = parser.parse_args(args)
wast_tool = None
+ interp_tool = None
if options.spec:
wast_tool = utils.Executable(
find_exe.GetWast2JsonExecutable(options.bindir),
error_cmdline=options.error_cmdline)
+ interp_tool = utils.Executable(
+ find_exe.GetSpectestInterpExecutable(options.bindir),
+ error_cmdline=options.error_cmdline)
else:
wast_tool = utils.Executable(
find_exe.GetWat2WasmExecutable(options.bindir),
error_cmdline=options.error_cmdline)
+ interp_tool = utils.Executable(
+ find_exe.GetWasmInterpExecutable(options.bindir),
+ error_cmdline=options.error_cmdline)
+ interp_tool.AppendOptionalArgs({
+ '--host-print': options.host_print,
+ '--run-all-exports': options.run_all_exports,
+ })
wast_tool.AppendOptionalArgs({
'-v': options.verbose,
@@ -68,13 +80,9 @@ def main(args):
'--enable-threads': options.enable_threads,
})
- wasm_interp = utils.Executable(
- find_exe.GetWasmInterpExecutable(options.bindir),
- error_cmdline=options.error_cmdline)
- wasm_interp.AppendOptionalArgs({
+ interp_tool.AppendOptionalArgs({
'-v': options.verbose,
'--run-all-exports': options.run_all_exports,
- '--spec': options.spec,
'--trace': options.trace,
'--enable-saturating-float-to-int':
options.enable_saturating_float_to_int,
@@ -82,13 +90,13 @@ def main(args):
})
wast_tool.verbose = options.print_cmd
- wasm_interp.verbose = options.print_cmd
+ interp_tool.verbose = options.print_cmd
with utils.TempDirectory(options.out_dir, 'run-interp-') as out_dir:
new_ext = '.json' if options.spec else '.wasm'
out_file = utils.ChangeDir(utils.ChangeExt(options.file, new_ext), out_dir)
wast_tool.RunWithArgs(options.file, '-o', out_file)
- wasm_interp.RunWithArgs(out_file)
+ interp_tool.RunWithArgs(out_file)
return 0