##// END OF EJS Templates
run-tests: handle interrupted in Test.run()
Gregory Szorc -
r21320:e5eed8de default
parent child Browse files
Show More
@@ -551,7 +551,8 b' class Test(object):'
551 runs cannot be run concurrently.
551 runs cannot be run concurrently.
552 """
552 """
553
553
554 def __init__(self, path, options, count, refpath):
554 def __init__(self, test, path, options, count, refpath):
555 self._test = test
555 self._path = path
556 self._path = path
556 self._options = options
557 self._options = options
557 self._count = count
558 self._count = count
@@ -598,7 +599,9 b' class Test(object):'
598 result.out = out
599 result.out = out
599 except KeyboardInterrupt:
600 except KeyboardInterrupt:
600 updateduration()
601 updateduration()
601 result.interrupted = True
602 log('INTERRUPTED: %s (after %d seconds)' % (self._test,
603 result.duration))
604 raise
602 except Exception, e:
605 except Exception, e:
603 updateduration()
606 updateduration()
604 result.exception = e
607 result.exception = e
@@ -673,7 +676,6 b' class TestResult(object):'
673 self.ret = None
676 self.ret = None
674 self.out = None
677 self.out = None
675 self.duration = None
678 self.duration = None
676 self.interrupted = False
677 self.exception = None
679 self.exception = None
678 self.refout = None
680 self.refout = None
679
681
@@ -1091,15 +1093,11 b' def runone(options, test, count):'
1091 if os.path.exists(err):
1093 if os.path.exists(err):
1092 os.remove(err) # Remove any previous output files
1094 os.remove(err) # Remove any previous output files
1093
1095
1094 t = runner(testpath, options, count, ref)
1096 t = runner(test, testpath, options, count, ref)
1095 res = TestResult()
1097 res = TestResult()
1096 t.run(res)
1098 t.run(res)
1097 t.cleanup()
1099 t.cleanup()
1098
1100
1099 if res.interrupted:
1100 log('INTERRUPTED: %s (after %d seconds)' % (test, res.duration))
1101 raise KeyboardInterrupt()
1102
1103 if res.exception:
1101 if res.exception:
1104 return fail('Exception during execution: %s' % res.exception, 255)
1102 return fail('Exception during execution: %s' % res.exception, 255)
1105
1103
General Comments 0
You need to be logged in to leave comments. Login now