mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-09-06 09:51:27 +00:00
Enable running WASI tests on Windows (#2489)
Tests are not passing yet therefore we don't enable them in CI.
This commit is contained in:
parent
aefb265b0d
commit
834e0314aa
|
@ -9,9 +9,22 @@ readonly MODE=$1
|
||||||
readonly TARGET=$2
|
readonly TARGET=$2
|
||||||
|
|
||||||
readonly WORK_DIR=$PWD
|
readonly WORK_DIR=$PWD
|
||||||
readonly PLATFORM=$(uname -s | tr A-Z a-z)
|
|
||||||
|
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then
|
||||||
|
readonly PLATFORM=windows
|
||||||
|
readonly PYTHON_EXE=python
|
||||||
|
# see https://github.com/pypa/virtualenv/commit/993ba1316a83b760370f5a3872b3f5ef4dd904c1
|
||||||
|
readonly VENV_BIN_DIR=Scripts
|
||||||
|
readonly IWASM_EXE=$(cygpath -m "${WORK_DIR}/../../../../product-mini/platforms/${PLATFORM}/build/RelWithDebInfo/iwasm.exe")
|
||||||
|
else
|
||||||
|
readonly PLATFORM=$(uname -s | tr A-Z a-z)
|
||||||
|
readonly VENV_BIN_DIR=bin
|
||||||
|
readonly PYTHON_EXE=python3
|
||||||
|
readonly IWASM_EXE="${WORK_DIR}/../../../../product-mini/platforms/${PLATFORM}/build/iwasm"
|
||||||
|
fi
|
||||||
|
|
||||||
readonly WAMR_DIR="${WORK_DIR}/../../../.."
|
readonly WAMR_DIR="${WORK_DIR}/../../../.."
|
||||||
readonly IWASM_CMD="${WORK_DIR}/../../../../product-mini/platforms/${PLATFORM}/build/iwasm \
|
readonly IWASM_CMD="${IWASM_EXE} \
|
||||||
--allow-resolve=google-public-dns-a.google.com \
|
--allow-resolve=google-public-dns-a.google.com \
|
||||||
--addr-pool=::1/128,127.0.0.1/32"
|
--addr-pool=::1/128,127.0.0.1/32"
|
||||||
readonly IWASM_CMD_STRESS="${IWASM_CMD} --max-threads=8"
|
readonly IWASM_CMD_STRESS="${IWASM_CMD} --max-threads=8"
|
||||||
|
@ -59,11 +72,11 @@ run_aot_tests () {
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ $MODE != "aot" ]];then
|
if [[ $MODE != "aot" ]];then
|
||||||
python3 -m venv wasi-env && source wasi-env/bin/activate
|
$PYTHON_EXE -m venv wasi-env && source wasi-env/${VENV_BIN_DIR}/activate
|
||||||
python3 -m pip install -r test-runner/requirements.txt
|
$PYTHON_EXE -m pip install -r test-runner/requirements.txt
|
||||||
|
|
||||||
# Stress test requires max-threads=8 so it's run separately
|
# Stress test requires max-threads=8 so it's run separately
|
||||||
if [[ -e "${THREAD_INTERNAL_TESTS}spawn_stress_test.wasm" ]]; then
|
if [[ -e "${THREAD_INTERNAL_TESTS}spawn_stress_test.wasm" ]]; then
|
||||||
${IWASM_CMD_STRESS} ${THREAD_INTERNAL_TESTS}spawn_stress_test.wasm
|
${IWASM_CMD_STRESS} ${THREAD_INTERNAL_TESTS}spawn_stress_test.wasm
|
||||||
ret=${PIPESTATUS[0]}
|
ret=${PIPESTATUS[0]}
|
||||||
if [ "${ret}" -ne 0 ]; then
|
if [ "${ret}" -ne 0 ]; then
|
||||||
|
@ -72,7 +85,7 @@ if [[ $MODE != "aot" ]];then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TEST_RUNTIME_EXE="${IWASM_CMD}" python3 test-runner/wasi_test_runner.py \
|
TEST_RUNTIME_EXE="${IWASM_CMD}" $PYTHON_EXE test-runner/wasi_test_runner.py \
|
||||||
-r adapters/wasm-micro-runtime.py \
|
-r adapters/wasm-micro-runtime.py \
|
||||||
-t \
|
-t \
|
||||||
${C_TESTS} \
|
${C_TESTS} \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user