553 |
553 |
554 def __init__(self, path, options, count, refpath): |
554 def __init__(self, path, options, count, refpath): |
555 self._path = path |
555 self._path = path |
556 self._options = options |
556 self._options = options |
557 self._count = count |
557 self._count = count |
|
558 self._daemonpids = [] |
558 |
559 |
559 # If we're not in --debug mode and reference output file exists, |
560 # If we're not in --debug mode and reference output file exists, |
560 # check test output against it. |
561 # check test output against it. |
561 if options.debug: |
562 if options.debug: |
562 self._refout = None # to match "out is None" |
563 self._refout = None # to match "out is None" |
569 |
570 |
570 self._threadtmp = os.path.join(HGTMP, 'child%d' % count) |
571 self._threadtmp = os.path.join(HGTMP, 'child%d' % count) |
571 os.mkdir(self._threadtmp) |
572 os.mkdir(self._threadtmp) |
572 |
573 |
573 def cleanup(self): |
574 def cleanup(self): |
|
575 for entry in self._daemonpids: |
|
576 killdaemons(entry) |
|
577 |
574 if self._threadtmp and not self._options.keep_tmpdir: |
578 if self._threadtmp and not self._options.keep_tmpdir: |
575 shutil.rmtree(self._threadtmp, True) |
579 shutil.rmtree(self._threadtmp, True) |
576 |
580 |
577 def run(self, result): |
581 def run(self, result): |
578 testtmp = os.path.join(self._threadtmp, os.path.basename(self._path)) |
582 testtmp = os.path.join(self._threadtmp, os.path.basename(self._path)) |
579 os.mkdir(testtmp) |
583 os.mkdir(testtmp) |
580 replacements, port = self._getreplacements(testtmp) |
584 replacements, port = self._getreplacements(testtmp) |
581 env = self._getenv(testtmp, port) |
585 env = self._getenv(testtmp, port) |
|
586 self._daemonpids.append(env['DAEMON_PIDS']) |
582 createhgrc(env['HGRCPATH'], self._options) |
587 createhgrc(env['HGRCPATH'], self._options) |
583 |
588 |
584 starttime = time.time() |
589 starttime = time.time() |
585 |
590 |
586 def updateduration(): |
591 def updateduration(): |