tests/run-tests.py
branchstable
changeset 1143 38b7bb8f1c85
parent 1139 cdabdd17f980
child 1149 a3d0e19724c3
equal deleted inserted replaced
1142:2a75107bd979 1143:38b7bb8f1c85
   919         f = open(err, "wb")
   919         f = open(err, "wb")
   920         for line in out:
   920         for line in out:
   921             f.write(line)
   921             f.write(line)
   922         f.close()
   922         f.close()
   923 
   923 
       
   924     def describe(ret):
       
   925         if ret < 0:
       
   926             return 'killed by signal %d' % -ret
       
   927         return 'returned error code %d' % ret
       
   928 
   924     if skipped:
   929     if skipped:
   925         mark = 's'
   930         mark = 's'
   926         if out is None:                 # debug mode: nothing to parse
   931         if out is None:                 # debug mode: nothing to parse
   927             missing = ['unknown']
   932             missing = ['unknown']
   928             failed = None
   933             failed = None
   946                 os.system("%s %s %s" % (options.view, ref, err))
   951                 os.system("%s %s %s" % (options.view, ref, err))
   947             else:
   952             else:
   948                 showdiff(refout, out, ref, err)
   953                 showdiff(refout, out, ref, err)
   949             iolock.release()
   954             iolock.release()
   950         if ret:
   955         if ret:
   951             fail("output changed and returned error code %d" % ret, ret)
   956             fail("output changed and " + describe(ret), ret)
   952         else:
   957         else:
   953             fail("output changed", ret)
   958             fail("output changed", ret)
   954         ret = 1
   959         ret = 1
   955     elif ret:
   960     elif ret:
   956         mark = '!'
   961         mark = '!'
   957         fail("returned error code %d" % ret, ret)
   962         fail(describe(ret), ret)
   958     else:
   963     else:
   959         success()
   964         success()
   960 
   965 
   961     if not options.verbose:
   966     if not options.verbose:
   962         iolock.acquire()
   967         iolock.acquire()