mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-07-15 08:48:33 +00:00
enable spec test on OSX
This commit is contained in:
parent
0bef866f38
commit
ee167e3ffa
31
.github/workflows/compilation_on_macos.yml
vendored
31
.github/workflows/compilation_on_macos.yml
vendored
|
@ -30,12 +30,18 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
# For building
|
||||||
AOT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
|
AOT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
|
||||||
CLASSIC_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
|
CLASSIC_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
|
||||||
FAST_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
|
FAST_INTERP_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=0 -DWAMR_BUILD_FAST_INTERP=1 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=0"
|
||||||
LAZY_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1"
|
LAZY_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1"
|
||||||
MC_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
|
MC_JIT_BUILD_OPTIONS: "-DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
|
||||||
LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex"
|
LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex"
|
||||||
|
# For spec Test
|
||||||
|
DEFAULT_TEST_OPTIONS: "-s spec"
|
||||||
|
MULTI_MODULES_TEST_OPTIONS: "-s spec -M"
|
||||||
|
SIMD_TEST_OPTIONS: "-s spec -S"
|
||||||
|
THREADS_TEST_OPTIONS: "-s spec -p"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# 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
|
||||||
|
@ -391,3 +397,28 @@ jobs:
|
||||||
cmake ..
|
cmake ..
|
||||||
cmake --build . --config Release --parallel 4
|
cmake --build . --config Release --parallel 4
|
||||||
./hello
|
./hello
|
||||||
|
|
||||||
|
spec_test_default:
|
||||||
|
if: ${{ endsWith(github.repository, 'wasm-micro-runtime') }}
|
||||||
|
needs: [build_iwasm, check_repo]
|
||||||
|
runs-on: macos-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
running_mode: ["classic-interp", "fast-interp"]
|
||||||
|
test_option:
|
||||||
|
[
|
||||||
|
$DEFAULT_TEST_OPTIONS,
|
||||||
|
$MULTI_MODULES_TEST_OPTIONS,
|
||||||
|
$SIMD_TEST_OPTIONS,
|
||||||
|
$THREADS_TEST_OPTIONS,
|
||||||
|
]
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: install Ninja
|
||||||
|
run: brew install ninja
|
||||||
|
|
||||||
|
- name: run spec tests
|
||||||
|
run: ./test_wamr.sh ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
|
||||||
|
working-directory: ./tests/wamr-test-suites
|
||||||
|
|
|
@ -58,8 +58,7 @@ else:
|
||||||
rundir = None
|
rundir = None
|
||||||
|
|
||||||
def create_a_runner(cmd, no_pty=False):
|
def create_a_runner(cmd, no_pty=False):
|
||||||
# return TTYRunner(cmd) if sys.platform == "darwin" else Runner(cmd, no_pty)
|
return TTYRunner(cmd) if sys.platform == "darwin" else Runner(cmd, no_pty)
|
||||||
return TTYRunner(cmd)
|
|
||||||
|
|
||||||
class Runner():
|
class Runner():
|
||||||
def __init__(self, args, no_pty=False):
|
def __init__(self, args, no_pty=False):
|
||||||
|
@ -322,7 +321,7 @@ def get_module_exp_from_assert(string):
|
||||||
|
|
||||||
def string_to_unsigned(number_in_string, lane_type):
|
def string_to_unsigned(number_in_string, lane_type):
|
||||||
if not lane_type in ['i8x16', 'i16x8', 'i32x4', 'i64x2']:
|
if not lane_type in ['i8x16', 'i16x8', 'i32x4', 'i64x2']:
|
||||||
raise Exception("invalid value {} and type {} and lane_type {}".format(numbers, type, lane_type))
|
raise Exception("invalid value {} and type {} and lane_type {}".format(number_in_string, type, lane_type))
|
||||||
|
|
||||||
number = int(number_in_string, 16) if '0x' in number_in_string else int(number_in_string)
|
number = int(number_in_string, 16) if '0x' in number_in_string else int(number_in_string)
|
||||||
|
|
||||||
|
@ -472,7 +471,7 @@ def int2int64(i):
|
||||||
|
|
||||||
|
|
||||||
def num_repr(i):
|
def num_repr(i):
|
||||||
if isinstance(i, int) or isinstance(i, long):
|
if isinstance(i, int):
|
||||||
return re.sub("L$", "", hex(i))
|
return re.sub("L$", "", hex(i))
|
||||||
else:
|
else:
|
||||||
return "%.16g" % i
|
return "%.16g" % i
|
||||||
|
@ -645,7 +644,6 @@ def test_assert(r, opts, mode, cmd, expected):
|
||||||
log("Testing(%s) %s = %s" % (mode, cmd, expected))
|
log("Testing(%s) %s = %s" % (mode, cmd, expected))
|
||||||
|
|
||||||
out = invoke(r, opts, cmd)
|
out = invoke(r, opts, cmd)
|
||||||
print("==> {}".format(out.encode("utf-8")))
|
|
||||||
if '\n' in out:
|
if '\n' in out:
|
||||||
outs = [''] + out.split('\n')[1:]
|
outs = [''] + out.split('\n')[1:]
|
||||||
out = outs[-1]
|
out = outs[-1]
|
||||||
|
@ -1138,21 +1136,17 @@ if __name__ == "__main__":
|
||||||
f = open(wasm_tempfile, 'wb' if IS_PY_3 else "w")
|
f = open(wasm_tempfile, 'wb' if IS_PY_3 else "w")
|
||||||
# f = open(wasm_tempfile, 'w')
|
# f = open(wasm_tempfile, 'w')
|
||||||
s = m.group(1)
|
s = m.group(1)
|
||||||
print("==>s: {}".format(s))
|
|
||||||
while s:
|
while s:
|
||||||
res = re.match("[^\"]*\"([^\"]*)\"(.*)", s, re.DOTALL)
|
res = re.match("[^\"]*\"([^\"]*)\"(.*)", s, re.DOTALL)
|
||||||
binary_module = res.group(1)
|
binary_module = res.group(1)
|
||||||
|
|
||||||
print("==>1. SZ:{} binary_module: \"{}\"".format(len(binary_module), binary_module))
|
|
||||||
if IS_PY_3:
|
if IS_PY_3:
|
||||||
binary_module = binary_module.replace("\\", "\\x").encode("raw_unicode_escape").decode("unicode_escape")
|
binary_module = binary_module.replace("\\", "\\x").encode("raw_unicode_escape").decode("unicode_escape")
|
||||||
binary_module = binary_module.encode("latin-1")
|
binary_module = binary_module.encode("latin-1")
|
||||||
else:
|
else:
|
||||||
binary_module = binary_module.replace("\\", "\\x").decode("string_escape")
|
binary_module = binary_module.replace("\\", "\\x").decode("string_escape")
|
||||||
print("==>2. SZ:{} binary_module: \"{}\"".format(len(binary_module), repr(binary_module)))
|
|
||||||
|
|
||||||
sz = f.write(binary_module)
|
sz = f.write(binary_module)
|
||||||
print("==>3. SZ:{} ".format(sz))
|
|
||||||
s = res.group(2)
|
s = res.group(2)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user