diff options
author | Ben Smith <binji@chromium.org> | 2016-10-24 14:02:18 -0700 |
---|---|---|
committer | Ben Smith <binji@chromium.org> | 2016-11-03 13:05:36 -0700 |
commit | 5a1be55f5a50c1df5cdce6412a589bafa5fab1df (patch) | |
tree | ec4f75ff60d7363331dc45e615eb07d199e0f2da /test/utils.py | |
parent | fe4f7d4f0d85826f8babbda76607654380cfc050 (diff) | |
download | wabt-5a1be55f5a50c1df5cdce6412a589bafa5fab1df.tar.gz wabt-5a1be55f5a50c1df5cdce6412a589bafa5fab1df.tar.bz2 wabt-5a1be55f5a50c1df5cdce6412a589bafa5fab1df.zip |
Use a new format for the spec JSON writer/parser
The previous spec JSON format was defined around modules. This is
because the previous spec tests would only run assertions on the most
recently read module. In addition, the previous spec writer would write
the assertions as new exported functions in the module, and run those.
The primary reason for doing this was to allow for passing/returning i64
values, which was necessary to test in a JavaScript host.
Now that the primary host for running the spec tests is wasm-interp, we
no longer need do bundle assertions into the module. Also, some of the
new spec tests allow running exported functions on a module that is not
the most-recently-read module.
The new spec test format is now defined around commands. The commands
map directly to the spec format commands, e.g. `module`,
`assert_invalid`, `assert_trap`, etc.
Diffstat (limited to 'test/utils.py')
-rw-r--r-- | test/utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/utils.py b/test/utils.py index 7dac9aab..254257cd 100644 --- a/test/utils.py +++ b/test/utils.py @@ -18,6 +18,7 @@ from __future__ import print_function import contextlib import os +import json import shutil import signal import subprocess @@ -163,3 +164,9 @@ def Hexdump(data): lines.append(line) return lines + + +def GetModuleFilenamesFromSpecJSON(json_filename): + with open(json_filename) as json_file: + json_data = json.load(json_file) + return [m['filename'] for m in json_data['commands'] if 'filename' in m] |