diff options
author | Ben Smith <binjimin@gmail.com> | 2017-09-08 07:35:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-08 07:35:33 -0700 |
commit | 6a582bccddb48009414c5d909dea1544bcfcc512 (patch) | |
tree | c6b4d83de2aa9764c0208e05549960e100a7c498 /test/run-interp.py | |
parent | 0ecaaacb27d03a1aafc40397740f9bdd04bf8d73 (diff) | |
download | wabt-6a582bccddb48009414c5d909dea1544bcfcc512.tar.gz wabt-6a582bccddb48009414c5d909dea1544bcfcc512.tar.bz2 wabt-6a582bccddb48009414c5d909dea1544bcfcc512.zip |
Rename wast2wasm -> wat2wasm, wast2json (#617)
* wat2wasm only parses wat files (individual modules)
* wast2json parses spec test files and generates json + wasm
Diffstat (limited to 'test/run-interp.py')
-rwxr-xr-x | test/run-interp.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/test/run-interp.py b/test/run-interp.py index 27aa081b..664a6d87 100755 --- a/test/run-interp.py +++ b/test/run-interp.py @@ -51,12 +51,18 @@ def main(args): parser.add_argument('--enable-threads', action='store_true') options = parser.parse_args(args) - wast2wasm = utils.Executable( - find_exe.GetWast2WasmExecutable(options.bindir), - error_cmdline=options.error_cmdline) - wast2wasm.AppendOptionalArgs({ + wast_tool = None + if options.spec: + wast_tool = utils.Executable( + find_exe.GetWast2JsonExecutable(options.bindir), + error_cmdline=options.error_cmdline) + else: + wast_tool = utils.Executable( + find_exe.GetWat2WasmExecutable(options.bindir), + error_cmdline=options.error_cmdline) + + wast_tool.AppendOptionalArgs({ '-v': options.verbose, - '--spec': options.spec, '--enable-saturating-float-to-int': options.enable_saturating_float_to_int, '--enable-threads': options.enable_threads, @@ -75,13 +81,13 @@ def main(args): '--enable-threads': options.enable_threads, }) - wast2wasm.verbose = options.print_cmd + wast_tool.verbose = options.print_cmd wasm_interp.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) - wast2wasm.RunWithArgs(options.file, '-o', out_file) + wast_tool.RunWithArgs(options.file, '-o', out_file) wasm_interp.RunWithArgs(out_file) return 0 |