|
@@ -105,6 +105,9 @@ class Runner():
|
|
|
[outs,_,_] = select([self.stdout], [], [], 1)
|
|
[outs,_,_] = select([self.stdout], [], [], 1)
|
|
|
if self.stdout in outs:
|
|
if self.stdout in outs:
|
|
|
new_data = self.stdout.read(1)
|
|
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
|
|
new_data = new_data.decode("utf-8") if IS_PY_3 else new_data
|
|
|
#print("new_data: '%s'" % new_data)
|
|
#print("new_data: '%s'" % new_data)
|
|
|
debug(new_data)
|
|
debug(new_data)
|
|
@@ -139,6 +142,11 @@ class Runner():
|
|
|
except OSError:
|
|
except OSError:
|
|
|
pass
|
|
pass
|
|
|
self.p = None
|
|
self.p = None
|
|
|
|
|
+ self.stdin.close()
|
|
|
|
|
+ if self.stdin != self.stdout:
|
|
|
|
|
+ self.stdout.close()
|
|
|
|
|
+ self.stdin = None
|
|
|
|
|
+ self.stdout = None
|
|
|
sys.exc_clear()
|
|
sys.exc_clear()
|
|
|
|
|
|
|
|
def assert_prompt(runner, prompts, timeout, is_need_execute_result):
|
|
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):
|
|
if not os.path.exists(temp_file_directory):
|
|
|
os.mkdir(temp_file_directory)
|
|
os.mkdir(temp_file_directory)
|
|
|
|
|
|
|
|
|
|
+ def makefile(name):
|
|
|
|
|
+ open(name, "w").close()
|
|
|
|
|
+
|
|
|
# create temporal file with particular name
|
|
# create temporal file with particular name
|
|
|
temp_wast_file = os.path.join(temp_file_directory, ""+ wast_name + ".wast")
|
|
temp_wast_file = os.path.join(temp_file_directory, ""+ wast_name + ".wast")
|
|
|
if not os.path.exists(temp_wast_file):
|
|
if not os.path.exists(temp_wast_file):
|
|
|
- os.mknod(temp_wast_file)
|
|
|
|
|
|
|
+ makefile(temp_wast_file)
|
|
|
tempfiles.append(temp_wast_file)
|
|
tempfiles.append(temp_wast_file)
|
|
|
|
|
|
|
|
# now we define the same file name as wast for wasm & aot
|
|
# now we define the same file name as wast for wasm & aot
|
|
|
wasm_file = wast_name +".wasm"
|
|
wasm_file = wast_name +".wasm"
|
|
|
temp_wasm_file = os.path.join(temp_file_directory, wasm_file)
|
|
temp_wasm_file = os.path.join(temp_file_directory, wasm_file)
|
|
|
if not os.path.exists(temp_wasm_file):
|
|
if not os.path.exists(temp_wasm_file):
|
|
|
- os.mknod(temp_wasm_file)
|
|
|
|
|
|
|
+ makefile(temp_wasm_file)
|
|
|
tempfiles.append(temp_wasm_file)
|
|
tempfiles.append(temp_wasm_file)
|
|
|
|
|
|
|
|
if test_aot:
|
|
if test_aot:
|
|
|
aot_file = wast_name +".aot"
|
|
aot_file = wast_name +".aot"
|
|
|
temp_aot_file =os.path.join(temp_file_directory, aot_file)
|
|
temp_aot_file =os.path.join(temp_file_directory, aot_file)
|
|
|
if not os.path.exists(temp_aot_file):
|
|
if not os.path.exists(temp_aot_file):
|
|
|
- os.mknod(temp_aot_file)
|
|
|
|
|
|
|
+ makefile(temp_aot_file)
|
|
|
tempfiles.append(temp_aot_file)
|
|
tempfiles.append(temp_aot_file)
|
|
|
|
|
|
|
|
# add these temp file to temporal repo, will be deleted when finishing the test
|
|
# add these temp file to temporal repo, will be deleted when finishing the test
|