Compare commits

...

2 Commits

Author SHA1 Message Date
Xenia Lu
1ff24381b6
Fix the nuttx CI failures 2024-06-25 08:55:49 +08:00
Xenia Lu
3a680ec2a2
Remove built in check for global and add WASM_ENABLE_WASI_TEST macro 2024-06-25 07:19:12 +08:00
6 changed files with 14 additions and 4 deletions

View File

@ -233,6 +233,10 @@ if (WAMR_BUILD_SPEC_TEST EQUAL 1)
add_definitions (-DWASM_ENABLE_SPEC_TEST=1) add_definitions (-DWASM_ENABLE_SPEC_TEST=1)
message (" spec test compatible mode is on") message (" spec test compatible mode is on")
endif () endif ()
if (WAMR_BUILD_WASI_TEST EQUAL 1)
add_definitions (-DWASM_ENABLE_WASI_TEST=1)
message (" wasi test compatible mode is on")
endif ()
if (NOT DEFINED WAMR_BUILD_BULK_MEMORY) if (NOT DEFINED WAMR_BUILD_BULK_MEMORY)
# Enable bulk memory by default # Enable bulk memory by default
set (WAMR_BUILD_BULK_MEMORY 1) set (WAMR_BUILD_BULK_MEMORY 1)

View File

@ -363,6 +363,10 @@
#define WASM_ENABLE_SPEC_TEST 0 #define WASM_ENABLE_SPEC_TEST 0
#endif #endif
#ifndef WASM_ENABLE_WASI_TEST
#define WASM_ENABLE_WASI_TEST 0
#endif
/* Global heap pool size in bytes */ /* Global heap pool size in bytes */
#ifndef WASM_GLOBAL_HEAP_SIZE #ifndef WASM_GLOBAL_HEAP_SIZE
#define WASM_GLOBAL_HEAP_SIZE (10 * 1024 * 1024) #define WASM_GLOBAL_HEAP_SIZE (10 * 1024 * 1024)

View File

@ -1268,7 +1268,7 @@ wasm_runtime_is_built_in_module(const char *module_name)
#if WASM_ENABLE_SPEC_TEST != 0 #if WASM_ENABLE_SPEC_TEST != 0
|| !strcmp("spectest", module_name) || !strcmp("spectest", module_name)
#endif #endif
#if WASM_ENABLE_LIB_WASI_THREADS != 0 #if WASM_ENABLE_WASI_TEST != 0
|| !strcmp("foo", module_name) || !strcmp("foo", module_name)
#endif #endif
|| !strcmp("", module_name)); || !strcmp("", module_name));

View File

@ -2904,7 +2904,7 @@ load_memory_import(const uint8 **p_buf, const uint8 *buf_end,
declare_init_page_count = spectest_memory_init_page; declare_init_page_count = spectest_memory_init_page;
declare_max_page_count = spectest_memory_max_page; declare_max_page_count = spectest_memory_max_page;
} }
#if WASM_ENABLE_LIB_WASI_THREADS != 0 #if WASM_ENABLE_WASI_TEST != 0
/* a case in wasi-testsuite which imports ("foo" "bar") */ /* a case in wasi-testsuite which imports ("foo" "bar") */
else if (!strcmp("foo", sub_module_name)) { else if (!strcmp("foo", sub_module_name)) {
uint32 spectest_memory_init_page = 1; uint32 spectest_memory_init_page = 1;

View File

@ -1718,8 +1718,7 @@ check_linked_symbol(WASMModuleInstance *module_inst, char *error_buf,
for (i = 0; i < module->import_global_count; i++) { for (i = 0; i < module->import_global_count; i++) {
WASMGlobalImport *global = &((module->import_globals + i)->u.global); WASMGlobalImport *global = &((module->import_globals + i)->u.global);
if (!global->is_linked if (!global->is_linked) {
&& !wasm_runtime_is_built_in_module(global->module_name)) {
#if WASM_ENABLE_SPEC_TEST != 0 #if WASM_ENABLE_SPEC_TEST != 0
set_error_buf(error_buf, error_buf_size, set_error_buf(error_buf, error_buf_size,
"unknown import or incompatible import type"); "unknown import or incompatible import type");

View File

@ -998,6 +998,9 @@ function trigger()
# if we're running the wasi certification tests. # if we're running the wasi certification tests.
if [[ $TEST_CASE_ARR ]]; then if [[ $TEST_CASE_ARR ]]; then
for test in "${TEST_CASE_ARR[@]}"; do for test in "${TEST_CASE_ARR[@]}"; do
if [[ "$test" == "wasi_certification" ]]; then
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_WASI_TEST=1"
fi
if [[ "$test" == "wasi_certification" if [[ "$test" == "wasi_certification"
|| "$test" == "standalone" ]]; then || "$test" == "standalone" ]]; then
EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1" EXTRA_COMPILE_FLAGS+=" -DWAMR_BUILD_LIBC_UVWASI=0 -DWAMR_BUILD_LIBC_WASI=1"