comparison tests/run-tests.py @ 21302:9e5d8eaa4a20

run-tests: move killdaemons into Test.run() killdaemons() was the only part of runone() looking at env variables. We move killdaemons() into Test.run() to enable us to fully move env into Test.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 19 Apr 2014 13:22:52 -0700
parents a77f4c2e1898
children 21a706020dd6
comparison
equal deleted inserted replaced
21301:a77f4c2e1898 21302:9e5d8eaa4a20
558 self._setreplacements(count) 558 self._setreplacements(count)
559 559
560 def run(self, env): 560 def run(self, env):
561 createhgrc(env['HGRCPATH'], self._options) 561 createhgrc(env['HGRCPATH'], self._options)
562 562
563 return self._run(self._replacements, env) 563 try:
564 return self._run(self._replacements, env)
565 finally:
566 killdaemons(env['DAEMON_PIDS'])
564 567
565 def _run(self, replacements, env): 568 def _run(self, replacements, env):
566 raise NotImplemented('Subclasses must implement Test.run()') 569 raise NotImplemented('Subclasses must implement Test.run()')
567 570
568 def _setreplacements(self, count): 571 def _setreplacements(self, count):
1034 raise 1037 raise
1035 endtime = time.time() 1038 endtime = time.time()
1036 times.append((test, endtime - starttime)) 1039 times.append((test, endtime - starttime))
1037 vlog("# Ret was:", ret) 1040 vlog("# Ret was:", ret)
1038 1041
1039 killdaemons(env['DAEMON_PIDS'])
1040
1041 skipped = (ret == SKIPPED_STATUS) 1042 skipped = (ret == SKIPPED_STATUS)
1042 1043
1043 # If we're not in --debug mode and reference output file exists, 1044 # If we're not in --debug mode and reference output file exists,
1044 # check test output against it. 1045 # check test output against it.
1045 if options.debug: 1046 if options.debug: