equal
deleted
inserted
replaced
345 """ |
345 """ |
346 |
346 |
347 # Status code reserved for skipped tests (used by hghave). |
347 # Status code reserved for skipped tests (used by hghave). |
348 SKIPPED_STATUS = 80 |
348 SKIPPED_STATUS = 80 |
349 |
349 |
350 def __init__(self, runner, test, count, refpath): |
350 def __init__(self, runner, test, count, refpath, unittest=False): |
351 path = os.path.join(runner.testdir, test) |
351 path = os.path.join(runner.testdir, test) |
352 errpath = os.path.join(runner.testdir, '%s.err' % test) |
352 errpath = os.path.join(runner.testdir, '%s.err' % test) |
353 |
353 |
354 self._runner = runner |
354 self._runner = runner |
355 self._testdir = runner.testdir |
355 self._testdir = runner.testdir |
358 self._options = runner.options |
358 self._options = runner.options |
359 self._count = count |
359 self._count = count |
360 self._daemonpids = [] |
360 self._daemonpids = [] |
361 self._refpath = refpath |
361 self._refpath = refpath |
362 self._errpath = errpath |
362 self._errpath = errpath |
|
363 self._unittest = unittest |
363 |
364 |
364 # If we're not in --debug mode and reference output file exists, |
365 # If we're not in --debug mode and reference output file exists, |
365 # check test output against it. |
366 # check test output against it. |
366 if runner.options.debug: |
367 if runner.options.debug: |
367 self._refout = None # to match "out is None" |
368 self._refout = None # to match "out is None" |
1299 if lctest.endswith(ext): |
1300 if lctest.endswith(ext): |
1300 testcls = cls |
1301 testcls = cls |
1301 refpath = os.path.join(self.testdir, test + out) |
1302 refpath = os.path.join(self.testdir, test + out) |
1302 break |
1303 break |
1303 |
1304 |
1304 t = testcls(self, test, count, refpath) |
1305 t = testcls(self, test, count, refpath, unittest=asunit) |
1305 |
1306 |
1306 if not asunit: |
1307 if not asunit: |
1307 return t |
1308 return t |
1308 |
1309 |
1309 class MercurialTest(unittest.TestCase): |
1310 class MercurialTest(unittest.TestCase): |