Enable wamr-test-suites on MacOS (#740)
This commit is contained in:
@ -18,7 +18,8 @@ DEBUG set -xevu
|
||||
readonly SPEC_TEST_DIR="spec/test/core"
|
||||
readonly WAST2WASM_CMD="./wabt/out/gcc/Release/wat2wasm"
|
||||
readonly WAMRC_CMD="../../../wamr-compiler/build/wamrc"
|
||||
IWASM_CMD="../../../product-mini/platforms/linux/build/iwasm"
|
||||
PLATFORM=$(uname -s | tr A-Z a-z)
|
||||
IWASM_CMD="../../../product-mini/platforms/${PLATFORM}/build/iwasm"
|
||||
|
||||
# "imports" and "linking" are only avilable when enabling multi modules
|
||||
# "comments" is for runtest.py
|
||||
|
||||
@ -105,6 +105,9 @@ class Runner():
|
||||
[outs,_,_] = select([self.stdout], [], [], 1)
|
||||
if self.stdout in outs:
|
||||
new_data = self.stdout.read(1)
|
||||
if not new_data:
|
||||
# EOF on macOS ends up here.
|
||||
break
|
||||
new_data = new_data.decode("utf-8") if IS_PY_3 else new_data
|
||||
#print("new_data: '%s'" % new_data)
|
||||
debug(new_data)
|
||||
@ -139,6 +142,11 @@ class Runner():
|
||||
except OSError:
|
||||
pass
|
||||
self.p = None
|
||||
self.stdin.close()
|
||||
if self.stdin != self.stdout:
|
||||
self.stdout.close()
|
||||
self.stdin = None
|
||||
self.stdout = None
|
||||
sys.exc_clear()
|
||||
|
||||
def assert_prompt(runner, prompts, timeout, is_need_execute_result):
|
||||
@ -979,24 +987,27 @@ def create_tmpfiles(wast_name):
|
||||
if not os.path.exists(temp_file_directory):
|
||||
os.mkdir(temp_file_directory)
|
||||
|
||||
def makefile(name):
|
||||
open(name, "w").close()
|
||||
|
||||
# create temporal file with particular name
|
||||
temp_wast_file = os.path.join(temp_file_directory, ""+ wast_name + ".wast")
|
||||
if not os.path.exists(temp_wast_file):
|
||||
os.mknod(temp_wast_file)
|
||||
makefile(temp_wast_file)
|
||||
tempfiles.append(temp_wast_file)
|
||||
|
||||
# now we define the same file name as wast for wasm & aot
|
||||
wasm_file = wast_name +".wasm"
|
||||
temp_wasm_file = os.path.join(temp_file_directory, wasm_file)
|
||||
if not os.path.exists(temp_wasm_file):
|
||||
os.mknod(temp_wasm_file)
|
||||
makefile(temp_wasm_file)
|
||||
tempfiles.append(temp_wasm_file)
|
||||
|
||||
if test_aot:
|
||||
aot_file = wast_name +".aot"
|
||||
temp_aot_file =os.path.join(temp_file_directory, aot_file)
|
||||
if not os.path.exists(temp_aot_file):
|
||||
os.mknod(temp_aot_file)
|
||||
makefile(temp_aot_file)
|
||||
tempfiles.append(temp_aot_file)
|
||||
|
||||
# add these temp file to temporal repo, will be deleted when finishing the test
|
||||
|
||||
Reference in New Issue
Block a user