336 """ |
336 """ |
337 |
337 |
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, test, count): |
341 def __init__(self, runner, path, count): |
342 path = os.path.join(runner.testdir, test) |
342 """Create a test from parameters. |
343 errpath = os.path.join(runner.testdir, '%s.err' % test) |
343 |
344 |
344 runner is a TestRunner instance. |
345 self.name = test |
345 |
|
346 path is the full path to the file defining the test. |
|
347 |
|
348 count is an identifier used to denote this test instance. |
|
349 """ |
|
350 |
|
351 self._path = path |
|
352 self.name = os.path.basename(path) |
|
353 self._testdir = os.path.dirname(path) |
|
354 self._errpath = os.path.join(self._testdir, '%s.err' % self.name) |
346 |
355 |
347 self._runner = runner |
356 self._runner = runner |
348 self._testdir = runner.testdir |
|
349 self._path = path |
|
350 self._options = runner.options |
357 self._options = runner.options |
351 self._count = count |
358 self._count = count |
352 self._daemonpids = [] |
359 self._daemonpids = [] |
353 self._errpath = errpath |
|
354 |
360 |
355 self._finished = None |
361 self._finished = None |
356 self._ret = None |
362 self._ret = None |
357 self._out = None |
363 self._out = None |
358 self._skipped = None |
364 self._skipped = None |
1459 for ext, cls in self.TESTTYPES: |
1465 for ext, cls in self.TESTTYPES: |
1460 if lctest.endswith(ext): |
1466 if lctest.endswith(ext): |
1461 testcls = cls |
1467 testcls = cls |
1462 break |
1468 break |
1463 |
1469 |
1464 return testcls(self, test, count) |
1470 return testcls(self, os.path.join(self.testdir, test), count) |
1465 |
1471 |
1466 def _cleanup(self): |
1472 def _cleanup(self): |
1467 """Clean up state from this test invocation.""" |
1473 """Clean up state from this test invocation.""" |
1468 |
1474 |
1469 if self.options.keep_tmpdir: |
1475 if self.options.keep_tmpdir: |