Commit 3eba2011 authored by Alexander Alekhin's avatar Alexander Alekhin

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

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