mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-13 21:21:22 +00:00
Fix spec tests on windows, enable spec tests for windows in CI (#2473)
This commit is contained in:
parent
ea763009b7
commit
3534980c9e
33
.github/workflows/compilation_on_windows.yml
vendored
33
.github/workflows/compilation_on_windows.yml
vendored
|
@ -39,6 +39,12 @@ on:
|
||||||
# allow to be triggered manually
|
# allow to be triggered manually
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
# For Spec Test
|
||||||
|
DEFAULT_TEST_OPTIONS: "-s spec -b"
|
||||||
|
MULTI_MODULES_TEST_OPTIONS: "-s spec -b -M"
|
||||||
|
THREADS_TEST_OPTIONS: "-s spec -b -p"
|
||||||
|
|
||||||
# Cancel any in-flight jobs for the same PR/branch so there's only one active
|
# Cancel any in-flight jobs for the same PR/branch so there's only one active
|
||||||
# at a time
|
# at a time
|
||||||
concurrency:
|
concurrency:
|
||||||
|
@ -77,3 +83,30 @@ jobs:
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
cmake .. ${{ matrix.build_options }}
|
cmake .. ${{ matrix.build_options }}
|
||||||
cmake --build . --config Release --parallel 4
|
cmake --build . --config Release --parallel 4
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: windows-latest
|
||||||
|
needs: [build]
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
running_mode:
|
||||||
|
[
|
||||||
|
"classic-interp",
|
||||||
|
"fast-interp",
|
||||||
|
]
|
||||||
|
test_option:
|
||||||
|
[
|
||||||
|
$DEFAULT_TEST_OPTIONS,
|
||||||
|
$MULTI_MODULES_TEST_OPTIONS,
|
||||||
|
$THREADS_TEST_OPTIONS,
|
||||||
|
]
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: run tests
|
||||||
|
shell: bash
|
||||||
|
timeout-minutes: 20
|
||||||
|
run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
|
||||||
|
working-directory: ./tests/wamr-test-suites
|
||||||
|
|
|
@ -370,6 +370,18 @@ execute_func(WASMModuleInstanceCommon *module_inst, const char *name,
|
||||||
{
|
{
|
||||||
float32 f32 = strtof(argv[i], &endptr);
|
float32 f32 = strtof(argv[i], &endptr);
|
||||||
if (isnan(f32)) {
|
if (isnan(f32)) {
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
/*
|
||||||
|
* Spec tests require the binary representation of NaN to be
|
||||||
|
* 0x7fc00000 for float and 0x7ff8000000000000 for float;
|
||||||
|
* however, in MSVC compiler, strtof doesn't return this
|
||||||
|
* exact value, causing some of the spec test failures. We
|
||||||
|
* use the value returned by nan/nanf as it is the one
|
||||||
|
* expected by spec tests.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
f32 = nanf("");
|
||||||
|
#endif
|
||||||
if (argv[i][0] == '-') {
|
if (argv[i][0] == '-') {
|
||||||
union ieee754_float u;
|
union ieee754_float u;
|
||||||
u.f = f32;
|
u.f = f32;
|
||||||
|
@ -404,6 +416,9 @@ execute_func(WASMModuleInstanceCommon *module_inst, const char *name,
|
||||||
} u;
|
} u;
|
||||||
u.val = strtod(argv[i], &endptr);
|
u.val = strtod(argv[i], &endptr);
|
||||||
if (isnan(u.val)) {
|
if (isnan(u.val)) {
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
u.val = nan("");
|
||||||
|
#endif
|
||||||
if (argv[i][0] == '-') {
|
if (argv[i][0] == '-') {
|
||||||
union ieee754_double ud;
|
union ieee754_double ud;
|
||||||
ud.d = u.val;
|
ud.d = u.val;
|
||||||
|
@ -567,7 +582,7 @@ execute_func(WASMModuleInstanceCommon *module_inst, const char *name,
|
||||||
{
|
{
|
||||||
#if UINTPTR_MAX == UINT32_MAX
|
#if UINTPTR_MAX == UINT32_MAX
|
||||||
if (argv1[k] != 0 && argv1[k] != (uint32)-1)
|
if (argv1[k] != 0 && argv1[k] != (uint32)-1)
|
||||||
os_printf("%p:ref.extern", (void *)argv1[k]);
|
os_printf("0x%" PRIxPTR ":ref.extern", (void *)argv1[k]);
|
||||||
else
|
else
|
||||||
os_printf("extern:ref.null");
|
os_printf("extern:ref.null");
|
||||||
k++;
|
k++;
|
||||||
|
@ -580,7 +595,7 @@ execute_func(WASMModuleInstanceCommon *module_inst, const char *name,
|
||||||
u.parts[1] = argv1[k + 1];
|
u.parts[1] = argv1[k + 1];
|
||||||
k += 2;
|
k += 2;
|
||||||
if (u.val && u.val != (uintptr_t)-1LL)
|
if (u.val && u.val != (uintptr_t)-1LL)
|
||||||
os_printf("%p:ref.extern", (void *)u.val);
|
os_printf("0x%" PRIxPTR ":ref.extern", (void *)u.val);
|
||||||
else
|
else
|
||||||
os_printf("extern:ref.null");
|
os_printf("extern:ref.null");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user