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