From 5a1be55f5a50c1df5cdce6412a589bafa5fab1df Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Mon, 24 Oct 2016 14:02:18 -0700 Subject: 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. --- test/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/utils.py') 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] -- cgit v1.2.3