提交 3eba2011 编写于 作者: A Alexander Alekhin

test: run.py: return valid errorCode in case of the single test run

上级 d5723480
......@@ -7,6 +7,8 @@ from subprocess import Popen, PIPE
hostos = os.name # 'nt', 'posix'
hostmachine = platform.machine() # 'x86', 'AMD64', 'x86_64'
errorCode = 0
SIMD_DETECTION_PROGRAM="""
#if __SSE5__
# error SSE5
......@@ -641,6 +643,8 @@ class TestSuite(object):
return True
def runTest(self, path, workingDir, _stdout, _stderr, args = []):
global errorCode
if self.error:
return
args = args[:]
......@@ -759,9 +763,9 @@ class TestSuite(object):
print >> _stderr, "Run command:", " ".join(cmd)
try:
Popen(cmd, stdout=_stdout, stderr=_stderr, cwd = self.java_test_binary_dir + "/.build").wait()
except OSError:
pass
errorCode = Popen(cmd, stdout=_stdout, stderr=_stderr, cwd = self.java_test_binary_dir + "/.build").wait()
except:
print "Unexpected error:", sys.exc_info()[0]
return None
else:
......@@ -777,9 +781,9 @@ class TestSuite(object):
print >> _stderr, "Run command:", " ".join(cmd)
try:
Popen(cmd, stdout=_stdout, stderr=_stderr, cwd = workingDir).wait()
except OSError:
pass
errorCode = Popen(cmd, stdout=_stdout, stderr=_stderr, cwd = workingDir).wait()
except:
print "Unexpected error:", sys.exc_info()[0]
# clean temporary files
if orig_temp_path:
......@@ -891,3 +895,7 @@ if __name__ == "__main__":
if logs:
print >> sys.stderr, "Collected: ", " ".join(logs)
if errorCode != 0:
print "Error code: ", errorCode, (" (0x%x)" % (errorCode & 0xffffffff))
exit(errorCode)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册