tests: correctly report a test killed by a signal stable
authorBryan O'Sullivan <bryano@fb.com>
Thu, 11 Oct 2012 16:05:14 -0700
branchstable
changeset 1143 38b7bb8f1c85
parent 1142 2a75107bd979
child 1144 3222b5b93410
child 1145 446f29d60749
tests: correctly report a test killed by a signal [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Fri Oct 12 23:46:19 2012 +0200
+++ 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()