changeset 17751:4871c1f343fa

tests: correctly report a test killed by a signal
author Bryan O'Sullivan <bryano@fb.com>
date Thu, 11 Oct 2012 16:05:14 -0700
parents aad3bce98f76
children 76b73ce0ffac
files tests/run-tests.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Tue Oct 09 16:17:55 2012 +0900
+++ b/tests/run-tests.py	Thu Oct 11 16:05:14 2012 -0700
@@ -921,6 +921,11 @@
             f.write(line)
         f.close()
 
+    def describe(ret):
+        if ret < 0:
+            return 'killed by signal %d' % -ret
+        return 'returned error code %d' % ret
+
     if skipped:
         mark = 's'
         if out is None:                 # debug mode: nothing to parse
@@ -948,13 +953,13 @@
                 showdiff(refout, out, ref, err)
             iolock.release()
         if ret:
-            fail("output changed and returned error code %d" % ret, ret)
+            fail("output changed and " + describe(ret), ret)
         else:
             fail("output changed", ret)
         ret = 1
     elif ret:
         mark = '!'
-        fail("returned error code %d" % ret, ret)
+        fail(describe(ret), ret)
     else:
         success()