Merge branch main into dev/wasi-libc-windows

This commit is contained in:
Wenyong Huang
2023-10-08 15:03:35 +08:00
151 changed files with 5909 additions and 2046 deletions

View File

@ -51,6 +51,7 @@ WAST2WASM_CMD = exe_file_path("./wabt/out/gcc/Release/wat2wasm")
SPEC_INTERPRETER_CMD = "spec/interpreter/wasm"
WAMRC_CMD = "../../../wamr-compiler/build/wamrc"
class TargetAction(argparse.Action):
TARGET_MAP = {
"ARMV7_VFP": "armv7",
@ -63,6 +64,7 @@ class TargetAction(argparse.Action):
"THUMBV7_VFP": "thumbv7",
"X86_32": "i386",
"X86_64": "x86_64",
"AARCH64": "arm64"
}
def __call__(self, parser, namespace, values, option_string=None):
@ -79,7 +81,7 @@ def ignore_the_case(
simd_flag=False,
gc_flag=False,
xip_flag=False,
qemu_flag=False
qemu_flag=False,
):
if case_name in ["comments", "inline-module", "names"]:
return True
@ -93,7 +95,7 @@ def ignore_the_case(
if gc_flag:
if case_name in ["type-canon", "type-equivalence", "type-rec"]:
return True;
return True
if sgx_flag:
if case_name in ["conversions", "f32_bitwise", "f64_bitwise"]:
@ -108,9 +110,20 @@ def ignore_the_case(
return True
if qemu_flag:
if case_name in ["f32_bitwise", "f64_bitwise", "loop", "f64", "f64_cmp",
"conversions", "f32", "f32_cmp", "float_exprs",
"float_misc", "select", "memory_grow"]:
if case_name in [
"f32_bitwise",
"f64_bitwise",
"loop",
"f64",
"f64_cmp",
"conversions",
"f32",
"f32_cmp",
"float_exprs",
"float_misc",
"select",
"memory_grow",
]:
return True
return False
@ -145,27 +158,10 @@ def test_case(
verbose_flag=True,
gc_flag=False,
qemu_flag=False,
qemu_firmware='',
log='',
qemu_firmware="",
log="",
no_pty=False
):
case_path = pathlib.Path(case_path).resolve()
case_name = case_path.stem
if ignore_the_case(
case_name,
target,
aot_flag,
sgx_flag,
multi_module_flag,
multi_thread_flag,
simd_flag,
gc_flag,
xip_flag,
qemu_flag
):
return True
CMD = [sys.executable, "runtest.py"]
CMD.append("--wast2wasm")
CMD.append(WAST2WASM_CMD if not gc_flag else SPEC_INTERPRETER_CMD)
@ -213,11 +209,15 @@ def test_case(
if gc_flag:
CMD.append("--gc")
if log != '':
if log != "":
CMD.append("--log-dir")
CMD.append(log)
CMD.append(case_path)
case_path = pathlib.Path(case_path).resolve()
case_name = case_path.stem
CMD.append(str(case_path))
# print(f"============> use {' '.join(CMD)}")
print(f"============> run {case_name} ", end="")
with subprocess.Popen(
CMD,
@ -276,9 +276,9 @@ def test_suite(
gc_flag=False,
parl_flag=False,
qemu_flag=False,
qemu_firmware='',
log='',
no_pty=False
qemu_firmware="",
log="",
no_pty=False,
):
suite_path = pathlib.Path(SPEC_TEST_DIR).resolve()
if not suite_path.exists():
@ -294,6 +294,26 @@ def test_suite(
gc_case_list = sorted(suite_path.glob("gc/*.wast"))
case_list.extend(gc_case_list)
# ignore based on command line options
filtered_case_list = []
for case_path in case_list:
case_name = case_path.stem
if not ignore_the_case(
case_name,
target,
aot_flag,
sgx_flag,
multi_module_flag,
multi_thread_flag,
simd_flag,
gc_flag,
xip_flag,
qemu_flag,
):
filtered_case_list.append(case_path)
print(f"---> {len(case_list)} --filter--> {len(filtered_case_list)}")
case_list = filtered_case_list
case_count = len(case_list)
failed_case = 0
successful_case = 0
@ -455,7 +475,7 @@ def main():
)
parser.add_argument(
"--log",
default='',
default="",
dest="log",
help="Log directory",
)
@ -484,7 +504,6 @@ def main():
help="Use direct pipes instead of pseudo-tty")
options = parser.parse_args()
print(options)
if not preflight_check(options.aot_flag):
return False
@ -536,7 +555,7 @@ def main():
options.qemu_flag,
options.qemu_firmware,
options.log,
options.no_pty
options.no_pty,
)
else:
ret = True