tests/run-tests.py
changeset 21504 888a5dfe1569
parent 21502 f8515564d617
child 21505 3a1881dbf860
--- a/tests/run-tests.py	Thu Mar 07 14:17:56 2013 +1100
+++ b/tests/run-tests.py	Tue Apr 22 10:05:32 2014 -0700
@@ -338,7 +338,7 @@
     # Status code reserved for skipped tests (used by hghave).
     SKIPPED_STATUS = 80
 
-    def __init__(self, runner, path, count):
+    def __init__(self, runner, path, count, tmpdir):
         """Create a test from parameters.
 
         runner is a TestRunner instance.
@@ -346,6 +346,8 @@
         path is the full path to the file defining the test.
 
         count is an identifier used to denote this test instance.
+
+        tmpdir is the main temporary directory to use for this test.
         """
 
         self._path = path
@@ -356,6 +358,7 @@
         self._runner = runner
         self._options = runner.options
         self._count = count
+        self._threadtmp = tmpdir
         self._daemonpids = []
 
         self._finished = None
@@ -375,8 +378,6 @@
         else:
             self._refout = []
 
-        self._threadtmp = os.path.join(runner.hgtmp, 'child%d' % count)
-
     def __str__(self):
         return self.name
 
@@ -1467,7 +1468,10 @@
                 testcls = cls
                 break
 
-        return testcls(self, os.path.join(self.testdir, test), count)
+        refpath = os.path.join(self.testdir, test)
+        tmpdir = os.path.join(self.hgtmp, 'child%d' % count)
+
+        return testcls(self, refpath, count, tmpdir)
 
     def _cleanup(self):
         """Clean up state from this test invocation."""