Skip to content

Commit 7814144

Browse files
committed
Update WABT downloads URL
Plus, skip unsupported running mode instead quit during wamr compiler test
1 parent 7f968f5 commit 7814144

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

tests/wamr-test-suites/test_wamr.sh

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ function sightglass_test()
361361

362362
function setup_wabt()
363363
{
364-
WABT_VERSION=1.0.37
364+
# please sync with .github/actions/install-wasi-sdk-wabt/action.yml
365365
if [ ${WABT_BINARY_RELEASE} == "YES" ]; then
366366
echo "download a binary release and install"
367367
local WAT2WASM=${WORK_DIR}/wabt/out/gcc/Release/wat2wasm
@@ -370,30 +370,30 @@ function setup_wabt()
370370
cosmopolitan)
371371
;;
372372
linux)
373-
WABT_PLATFORM=ubuntu-20.04
373+
WABT_URL=https://github.com/WebAssembly/wabt/releases/download/1.0.37/wabt-1.0.37-ubuntu-20.04.tar.gz
374+
WABT_VERSION=1.0.37
374375
;;
375376
darwin)
376-
WABT_PLATFORM=macos-12
377+
WABT_URL=https://github.com/WebAssembly/wabt/releases/download/1.0.36/wabt-1.0.36-macos-12.tar.gz
378+
WABT_VERSION=1.0.36
377379
;;
378380
windows)
379-
WABT_PLATFORM=windows
381+
WABT_URL=https://github.com/WebAssembly/wabt/releases/download/1.0.37/wabt-1.0.37-windows.tar.gz
382+
WABT_VERSION=1.0.37
380383
;;
381384
*)
382385
echo "wabt platform for ${PLATFORM} in unknown"
383386
exit 1
384387
;;
385388
esac
386-
if [ ! -f /tmp/wabt-${WABT_VERSION}-${WABT_PLATFORM}.tar.gz ]; then
387-
curl -L \
388-
https://github.com/WebAssembly/wabt/releases/download/${WABT_VERSION}/wabt-${WABT_VERSION}-${WABT_PLATFORM}.tar.gz \
389-
-o /tmp/wabt-${WABT_VERSION}-${WABT_PLATFORM}.tar.gz
390-
fi
391389

392-
cd /tmp \
393-
&& tar zxf wabt-${WABT_VERSION}-${WABT_PLATFORM}.tar.gz \
394-
&& mkdir -p ${WORK_DIR}/wabt/out/gcc/Release/ \
395-
&& install wabt-${WABT_VERSION}/bin/* ${WORK_DIR}/wabt/out/gcc/Release/ \
396-
&& cd -
390+
pushd /tmp
391+
wget -O wabt-tar.gz --progress=dot:giga ${WABT_URL}
392+
tar xf wabt-tar.gz
393+
popd
394+
395+
mkdir -p ${WORK_DIR}/wabt/out/gcc/Release/
396+
cp /tmp/wabt-${WABT_VERSION}/bin/* ${WORK_DIR}/wabt/out/gcc/Release/
397397
fi
398398
else
399399
echo "download source code and compile and install"
@@ -478,9 +478,9 @@ function spec_test()
478478
fi
479479

480480
# As of version 1.0.36, wabt is still unable to correctly handle the GC proposal.
481-
#
481+
#
482482
# $ $ /opt/wabt-1.0.36/bin/wast2json --enable-all ../spec/test/core/br_if.wast
483-
#
483+
#
484484
# ../spec/test/core/br_if.wast:670:26: error: unexpected token "null", expected a numeric index or a name (e.g. 12 or $foo).
485485
# (func $f (param (ref null $t)) (result funcref) (local.get 0))
486486
#
@@ -536,6 +536,9 @@ function spec_test()
536536
popd
537537
echo $(pwd)
538538

539+
#TODO: remove it when we can assume wabt is installed
540+
# especially for CI Or there is installation script in the project
541+
# that we can rely on
539542
setup_wabt
540543

541544
ln -sf ${WORK_DIR}/../spec-test-script/all.py .
@@ -622,8 +625,8 @@ function spec_test()
622625
function wamr_compiler_test()
623626
{
624627
if [[ $1 != "aot" ]]; then
625-
echo "WAMR compiler tests only support AOT mode"
626-
exit 1
628+
echo "WAMR compiler tests only support AOT mode, skip $1"
629+
return 0
627630
fi
628631

629632
echo "Now start WAMR compiler tests"

0 commit comments

Comments
 (0)