##// 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 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 556 self._path = path
556 557 self._options = options
557 558 self._count = count
@@ -598,7 +599,9 b' class Test(object):'
598 599 result.out = out
599 600 except KeyboardInterrupt:
600 601 updateduration()
601 result.interrupted = True
602 log('INTERRUPTED: %s (after %d seconds)' % (self._test,
603 result.duration))
604 raise
602 605 except Exception, e:
603 606 updateduration()
604 607 result.exception = e
@@ -673,7 +676,6 b' class TestResult(object):'
673 676 self.ret = None
674 677 self.out = None
675 678 self.duration = None
676 self.interrupted = False
677 679 self.exception = None
678 680 self.refout = None
679 681
@@ -1091,15 +1093,11 b' def runone(options, test, count):'
1091 1093 if os.path.exists(err):
1092 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 1097 res = TestResult()
1096 1098 t.run(res)
1097 1099 t.cleanup()
1098 1100
1099 if res.interrupted:
1100 log('INTERRUPTED: %s (after %d seconds)' % (test, res.duration))
1101 raise KeyboardInterrupt()
1102
1103 1101 if res.exception:
1104 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