Add ability to select spec version for testing

extensions
Volodymyr Shymanskyy 4 years ago
parent 8efc27f86f
commit 86af2f7bd6

@ -28,16 +28,17 @@ int main (int i_argc, const char * i_argv [])
m3Free (ftype);
result = SignatureToFuncType (& ftype, " v () "); expect (result == m3Err_none)
expect (ftype->returnType == c_m3Type_none)
expect (ftype->numRets == 0)
expect (ftype->numArgs == 0)
m3Free (ftype);
result = SignatureToFuncType (& ftype, "f(IiF)"); expect (result == m3Err_none)
expect (ftype->returnType == c_m3Type_f32)
expect (ftype->numRets == 1)
expect (ftype->types [0] == c_m3Type_f32)
expect (ftype->numArgs == 3)
expect (ftype->argTypes [0] == c_m3Type_i64)
expect (ftype->argTypes [1] == c_m3Type_i32)
expect (ftype->argTypes [2] == c_m3Type_f64)
expect (ftype->types [1] == c_m3Type_i64)
expect (ftype->types [2] == c_m3Type_i32)
expect (ftype->types [3] == c_m3Type_f64)
IM3FuncType ftype2 = NULL;
result = SignatureToFuncType (& ftype2, "f(I i F)"); expect (result == m3Err_none);

@ -48,6 +48,7 @@ from pprint import pprint
parser = argparse.ArgumentParser()
parser.add_argument("--exec", metavar="<interpreter>", default="../build/wasm3 --repl")
parser.add_argument("--spec", default="v1.1")
parser.add_argument("--timeout", type=int, default=30)
parser.add_argument("--line", metavar="<source line>", type=int)
parser.add_argument("--all", action="store_true")
@ -146,7 +147,7 @@ if not (os.path.isdir("./core") and os.path.isdir("./proposals")):
from zipfile import ZipFile
from urllib.request import urlopen
officialSpec = "https://github.com/wasm3/wasm-core-testsuite/archive/v1.1.zip"
officialSpec = f"https://github.com/wasm3/wasm-core-testsuite/archive/{args.spec}.zip"
print(f"Downloading {officialSpec}")
resp = urlopen(officialSpec)
@ -482,7 +483,9 @@ for fn in jsonFiles:
try:
wasm_fn = os.path.join(pathname(fn), wasm_module)
wasm3.load(wasm_fn)
res = wasm3.load(wasm_fn)
if res:
warning(res)
except Exception as e:
pass #fatal(str(e))

Loading…
Cancel
Save