Show More
@@ -556,11 +556,15 b' class Test(object):' | |||
|
556 | 556 | self._options = options |
|
557 | 557 | self._count = count |
|
558 | 558 | |
|
559 | self.threadtmp = os.path.join(HGTMP, 'child%d' % count) | |
|
560 | os.mkdir(self.threadtmp) | |
|
559 | self._threadtmp = os.path.join(HGTMP, 'child%d' % count) | |
|
560 | os.mkdir(self._threadtmp) | |
|
561 | ||
|
562 | def cleanup(self): | |
|
563 | if self._threadtmp and not self._options.keep_tmpdir: | |
|
564 | shutil.rmtree(self._threadtmp, True) | |
|
561 | 565 | |
|
562 | 566 | def run(self, result, refpath): |
|
563 | testtmp = os.path.join(self.threadtmp, os.path.basename(self._path)) | |
|
567 | testtmp = os.path.join(self._threadtmp, os.path.basename(self._path)) | |
|
564 | 568 | os.mkdir(testtmp) |
|
565 | 569 | replacements, port = self._getreplacements(testtmp) |
|
566 | 570 | env = self._getenv(testtmp, port) |
@@ -627,8 +631,8 b' class Test(object):' | |||
|
627 | 631 | env["HGPORT"] = str(port) |
|
628 | 632 | env["HGPORT1"] = str(port + 1) |
|
629 | 633 | env["HGPORT2"] = str(port + 2) |
|
630 | env["HGRCPATH"] = os.path.join(self.threadtmp, '.hgrc') | |
|
631 | env["DAEMON_PIDS"] = os.path.join(self.threadtmp, 'daemon.pids') | |
|
634 | env["HGRCPATH"] = os.path.join(self._threadtmp, '.hgrc') | |
|
635 | env["DAEMON_PIDS"] = os.path.join(self._threadtmp, 'daemon.pids') | |
|
632 | 636 | env["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"' |
|
633 | 637 | env["HGMERGE"] = "internal:merge" |
|
634 | 638 | env["HGUSER"] = "test" |
@@ -1073,6 +1077,7 b' def runone(options, test, count):' | |||
|
1073 | 1077 | t = runner(testpath, options, count) |
|
1074 | 1078 | res = TestResult() |
|
1075 | 1079 | t.run(res, ref) |
|
1080 | t.cleanup() | |
|
1076 | 1081 | |
|
1077 | 1082 | if res.interrupted: |
|
1078 | 1083 | log('INTERRUPTED: %s (after %d seconds)' % (test, res.duration)) |
@@ -1139,8 +1144,6 b' def runone(options, test, count):' | |||
|
1139 | 1144 | sys.stdout.flush() |
|
1140 | 1145 | iolock.release() |
|
1141 | 1146 | |
|
1142 | if not options.keep_tmpdir: | |
|
1143 | shutil.rmtree(t.threadtmp, True) | |
|
1144 | 1147 | return result |
|
1145 | 1148 | |
|
1146 | 1149 | _hgpath = None |
General Comments 0
You need to be logged in to leave comments.
Login now