##// END OF EJS Templates
run-tests: pass temp dir into Test.__init__...
Gregory Szorc -
r21504:888a5dfe default
parent child Browse files
Show More
@@ -338,7 +338,7 b' class Test(unittest.TestCase):'
338 # Status code reserved for skipped tests (used by hghave).
338 # Status code reserved for skipped tests (used by hghave).
339 SKIPPED_STATUS = 80
339 SKIPPED_STATUS = 80
340
340
341 def __init__(self, runner, path, count):
341 def __init__(self, runner, path, count, tmpdir):
342 """Create a test from parameters.
342 """Create a test from parameters.
343
343
344 runner is a TestRunner instance.
344 runner is a TestRunner instance.
@@ -346,6 +346,8 b' class Test(unittest.TestCase):'
346 path is the full path to the file defining the test.
346 path is the full path to the file defining the test.
347
347
348 count is an identifier used to denote this test instance.
348 count is an identifier used to denote this test instance.
349
350 tmpdir is the main temporary directory to use for this test.
349 """
351 """
350
352
351 self._path = path
353 self._path = path
@@ -356,6 +358,7 b' class Test(unittest.TestCase):'
356 self._runner = runner
358 self._runner = runner
357 self._options = runner.options
359 self._options = runner.options
358 self._count = count
360 self._count = count
361 self._threadtmp = tmpdir
359 self._daemonpids = []
362 self._daemonpids = []
360
363
361 self._finished = None
364 self._finished = None
@@ -375,8 +378,6 b' class Test(unittest.TestCase):'
375 else:
378 else:
376 self._refout = []
379 self._refout = []
377
380
378 self._threadtmp = os.path.join(runner.hgtmp, 'child%d' % count)
379
380 def __str__(self):
381 def __str__(self):
381 return self.name
382 return self.name
382
383
@@ -1467,7 +1468,10 b' class TestRunner(object):'
1467 testcls = cls
1468 testcls = cls
1468 break
1469 break
1469
1470
1470 return testcls(self, os.path.join(self.testdir, test), count)
1471 refpath = os.path.join(self.testdir, test)
1472 tmpdir = os.path.join(self.hgtmp, 'child%d' % count)
1473
1474 return testcls(self, refpath, count, tmpdir)
1471
1475
1472 def _cleanup(self):
1476 def _cleanup(self):
1473 """Clean up state from this test invocation."""
1477 """Clean up state from this test invocation."""
General Comments 0
You need to be logged in to leave comments. Login now