mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-09 13:16:26 +00:00
Update spec test cases to latest version (#889)
Update spec test cases to commit 2460ad02b51fb5ed5824f44de287a8638b19a5f8, and modify wamr test suite script as the SIMD cases have been added into spec main repo by default, no need to clone SIMD repo again when testing SIMD.
This commit is contained in:
parent
bbaf0a3c37
commit
e70867c64f
|
@ -3342,6 +3342,7 @@ create_sections(const uint8 *buf, uint32 size, WASMSection **p_section_list,
|
||||||
if (last_section_index != (uint8)-1
|
if (last_section_index != (uint8)-1
|
||||||
&& (section_index <= last_section_index)) {
|
&& (section_index <= last_section_index)) {
|
||||||
set_error_buf(error_buf, error_buf_size,
|
set_error_buf(error_buf, error_buf_size,
|
||||||
|
"unexpected content after last section or "
|
||||||
"junk after last section");
|
"junk after last section");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,63 +204,23 @@ def test_suite(
|
||||||
xip_flag=False,
|
xip_flag=False,
|
||||||
clean_up_flag=True,
|
clean_up_flag=True,
|
||||||
verbose_flag=True,
|
verbose_flag=True,
|
||||||
|
parl_flag=False,
|
||||||
):
|
):
|
||||||
suite_path = pathlib.Path(SPEC_TEST_DIR).resolve()
|
suite_path = pathlib.Path(SPEC_TEST_DIR).resolve()
|
||||||
if not suite_path.exists():
|
if not suite_path.exists():
|
||||||
print(f"can not find spec test cases at {suite_path}")
|
print(f"can not find spec test cases at {suite_path}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
case_list = sorted(suite_path.glob("**/*.wast"))
|
case_list = sorted(suite_path.glob("*.wast"))
|
||||||
|
if simd_flag:
|
||||||
|
simd_case_list = sorted(suite_path.glob("simd/*.wast"))
|
||||||
|
case_list.extend(simd_case_list)
|
||||||
|
|
||||||
case_count = len(case_list)
|
case_count = len(case_list)
|
||||||
failed_case = 0
|
failed_case = 0
|
||||||
successful_case = 0
|
successful_case = 0
|
||||||
for case_path in case_list:
|
|
||||||
try:
|
|
||||||
test_case(
|
|
||||||
str(case_path),
|
|
||||||
target,
|
|
||||||
aot_flag,
|
|
||||||
sgx_flag,
|
|
||||||
multi_module_flag,
|
|
||||||
multi_thread_flag,
|
|
||||||
simd_flag,
|
|
||||||
xip_flag,
|
|
||||||
clean_up_flag,
|
|
||||||
verbose_flag,
|
|
||||||
)
|
|
||||||
successful_case += 1
|
|
||||||
except Exception:
|
|
||||||
failed_case += 1
|
|
||||||
break
|
|
||||||
|
|
||||||
print(
|
if parl_flag:
|
||||||
f"IN ALL {case_count} cases: {successful_case} PASS, {failed_case} FAIL, {case_count - successful_case - failed_case} SKIP"
|
|
||||||
)
|
|
||||||
|
|
||||||
return 0 == failed_case
|
|
||||||
|
|
||||||
|
|
||||||
def test_suite_parallelly(
|
|
||||||
target,
|
|
||||||
aot_flag=False,
|
|
||||||
sgx_flag=False,
|
|
||||||
multi_module_flag=False,
|
|
||||||
multi_thread_flag=False,
|
|
||||||
simd_flag=False,
|
|
||||||
xip_flag=False,
|
|
||||||
clean_up_flag=False,
|
|
||||||
verbose_flag=False,
|
|
||||||
):
|
|
||||||
|
|
||||||
suite_path = pathlib.Path(SPEC_TEST_DIR).resolve()
|
|
||||||
if not suite_path.exists():
|
|
||||||
print(f"can not find spec test cases at {suite_path}")
|
|
||||||
return False
|
|
||||||
|
|
||||||
case_list = sorted(suite_path.glob("**/*.wast"))
|
|
||||||
case_count = len(case_list)
|
|
||||||
failed_case = 0
|
|
||||||
successful_case = 0
|
|
||||||
print(f"----- Run the whole spec test suite on {mp.cpu_count()} cores -----")
|
print(f"----- Run the whole spec test suite on {mp.cpu_count()} cores -----")
|
||||||
with mp.Pool() as pool:
|
with mp.Pool() as pool:
|
||||||
results = {}
|
results = {}
|
||||||
|
@ -292,6 +252,26 @@ def test_suite_parallelly(
|
||||||
except mp.TimeoutError:
|
except mp.TimeoutError:
|
||||||
print(f"{case_name} meets TimeoutError")
|
print(f"{case_name} meets TimeoutError")
|
||||||
failed_case += 1
|
failed_case += 1
|
||||||
|
else:
|
||||||
|
print(f"----- Run the whole spec test suite -----")
|
||||||
|
for case_path in case_list:
|
||||||
|
try:
|
||||||
|
test_case(
|
||||||
|
str(case_path),
|
||||||
|
target,
|
||||||
|
aot_flag,
|
||||||
|
sgx_flag,
|
||||||
|
multi_module_flag,
|
||||||
|
multi_thread_flag,
|
||||||
|
simd_flag,
|
||||||
|
xip_flag,
|
||||||
|
clean_up_flag,
|
||||||
|
verbose_flag,
|
||||||
|
)
|
||||||
|
successful_case += 1
|
||||||
|
except Exception:
|
||||||
|
failed_case += 1
|
||||||
|
break
|
||||||
|
|
||||||
print(
|
print(
|
||||||
f"IN ALL {case_count} cases: {successful_case} PASS, {failed_case} FAIL, {case_count - successful_case - failed_case} SKIP"
|
f"IN ALL {case_count} cases: {successful_case} PASS, {failed_case} FAIL, {case_count - successful_case - failed_case} SKIP"
|
||||||
|
@ -396,23 +376,6 @@ def main():
|
||||||
options.clean_up_flag = False
|
options.clean_up_flag = False
|
||||||
options.verbose_flag = False
|
options.verbose_flag = False
|
||||||
|
|
||||||
start = time.time_ns()
|
|
||||||
ret = test_suite_parallelly(
|
|
||||||
options.target,
|
|
||||||
options.aot_flag,
|
|
||||||
options.sgx_flag,
|
|
||||||
options.multi_module_flag,
|
|
||||||
options.multi_thread_flag,
|
|
||||||
options.simd_flag,
|
|
||||||
options.xip_flag,
|
|
||||||
options.clean_up_flag,
|
|
||||||
options.verbose_flag,
|
|
||||||
)
|
|
||||||
end = time.time_ns()
|
|
||||||
print(
|
|
||||||
f"It takes {((end - start) / 1000000):,} ms to run test_suite_parallelly"
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
start = time.time_ns()
|
start = time.time_ns()
|
||||||
ret = test_suite(
|
ret = test_suite(
|
||||||
options.target,
|
options.target,
|
||||||
|
@ -424,9 +387,12 @@ def main():
|
||||||
options.xip_flag,
|
options.xip_flag,
|
||||||
options.clean_up_flag,
|
options.clean_up_flag,
|
||||||
options.verbose_flag,
|
options.verbose_flag,
|
||||||
|
options.parl_flag,
|
||||||
)
|
)
|
||||||
end = time.time_ns()
|
end = time.time_ns()
|
||||||
print(f"It takes {((end - start) / 1000000):,} ms to run test_suite")
|
print(
|
||||||
|
f"It takes {((end - start) / 1000000):,} ms to run test_suite {'parallelly' if options.parl_flag else ''}"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
for case in options.cases:
|
for case in options.cases:
|
||||||
|
|
|
@ -279,8 +279,12 @@ function spec_test()
|
||||||
# restore from XX_ignore_cases.patch
|
# restore from XX_ignore_cases.patch
|
||||||
# resotre branch
|
# resotre branch
|
||||||
git checkout -B master
|
git checkout -B master
|
||||||
git reset --hard 397399a70565609bf142d211891724e21bffd01f
|
# [spec] Fix instruction table (#1402) Thu Dec 2 17:21:54 2021 +0100
|
||||||
|
git reset --hard 2460ad02b51fb5ed5824f44de287a8638b19a5f8
|
||||||
git apply ../../spec-test-script/ignore_cases.patch
|
git apply ../../spec-test-script/ignore_cases.patch
|
||||||
|
if [[ ${ENABLE_SIMD} == 1 ]]; then
|
||||||
|
git apply ../../spec-test-script/simd_ignore_cases.patch
|
||||||
|
fi
|
||||||
|
|
||||||
# udpate thread cases
|
# udpate thread cases
|
||||||
if [ ${ENABLE_MULTI_THREAD} == 1 ]; then
|
if [ ${ENABLE_MULTI_THREAD} == 1 ]; then
|
||||||
|
@ -298,20 +302,6 @@ function spec_test()
|
||||||
git apply ../../spec-test-script/thread_proposal_ignore_cases.patch
|
git apply ../../spec-test-script/thread_proposal_ignore_cases.patch
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# udpate SIMD cases
|
|
||||||
if [[ ${ENABLE_SIMD} == 1 ]]; then
|
|
||||||
echo "checkout spec for SIMD proposal"
|
|
||||||
# check spec test cases for simd
|
|
||||||
if [[ -z $(git remote | grep "\<simd\>") ]]; then
|
|
||||||
git remote add simd https://github.com/WebAssembly/simd.git
|
|
||||||
fi
|
|
||||||
|
|
||||||
git fetch simd
|
|
||||||
git checkout simd/main -- test/core/simd
|
|
||||||
|
|
||||||
git apply ../../spec-test-script/simd_ignore_cases.patch
|
|
||||||
fi
|
|
||||||
|
|
||||||
popd
|
popd
|
||||||
echo $(pwd)
|
echo $(pwd)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user