Added crash detection to tests on Linux.
authorsgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 29 Oct 2008 12:51:14 +0000 (12:51 +0000)
committersgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 29 Oct 2008 12:51:14 +0000 (12:51 +0000)
Added the timeout condition to the CommandOutput class.
Review URL: http://codereview.chromium.org/8695

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@639 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/mozilla/mozilla.status
tools/test.py

index 46ecc48622b2034538ffb007a0c9e97b9f806f4f..a5448c49ec0eac8e7513ecb9aecfce80494e7f6e 100644 (file)
@@ -193,7 +193,7 @@ ecma/String/15.5.4.12-4: FAIL_OK
 # unicode version converts it to itself.
 ecma/String/15.5.4.12-5: FAIL_OK
 
-# Creates a linked list of arrays until we run out of memory.
+# Creates a linked list of arrays until we run out of memory or timeout.
 js1_5/Regress/regress-312588: FAIL_OK
 
 
index 037e1cf4209878f491be70c93d55aa297889b33d..5b3579b7aed4eba1d14651fec8f6fa73a3d457d2 100755 (executable)
@@ -314,8 +314,9 @@ PROGRESS_INDICATORS = {
 
 class CommandOutput(object):
 
-  def __init__(self, exit_code, stdout, stderr):
+  def __init__(self, exit_code, timed_out, stdout, stderr):
     self.exit_code = exit_code
+    self.timed_out = timed_out
     self.stdout = stdout
     self.stderr = stderr
 
@@ -372,7 +373,11 @@ class TestOutput(object):
     if platform.system() == 'Windows':
       return 0x80000000 & self.output.exit_code and not (0x3FFFFF00 & self.output.exit_code)
     else:
-      return False
+      # Timed out tests will have exit_code -signal.SIGTERM.
+      if self.output.timed_out:
+        return False
+      return self.output.exit_code < 0 and \
+             self.output.exit_code != -signal.SIGABRT
 
   def HasFailed(self):
     execution_failed = self.test.DidFail(self.output)
@@ -471,7 +476,7 @@ def Execute(args, context, timeout=None):
       PrintError(str(e))
   CheckedUnlink(outname)
   CheckedUnlink(errname)
-  return CommandOutput(exit_code, output, errors)
+  return CommandOutput(exit_code, timed_out, output, errors)
 
 
 def ExecuteNoCapture(args, context, timeout=None):
@@ -480,7 +485,7 @@ def ExecuteNoCapture(args, context, timeout=None):
     timeout,
     args = args,
   )
-  return CommandOutput(exit_code, "", "")
+  return CommandOutput(exit_code, False, "", "")
 
 
 def CarCdr(path):