@@ -544,17 +544,20 @@ def outputcoverage(options):
class Test(object):
"""Encapsulates a single, runnable test.
Test instances can be run multiple times via run(). However, multiple
runs cannot be run concurrently.
"""
- def __init__(self, test, path, options, count, refpath, errpath):
+ def __init__(self, testdir, test, options, count, refpath):
+ path = os.path.join(testdir, test)
+ errpath = os.path.join(testdir, '%s.err' % test)
+
self._test = test
self._path = path
self._options = options
self._count = count
self._daemonpids = []
self._refpath = refpath
self._errpath = errpath
@@ -1127,29 +1130,27 @@ def run(cmd, wd, options, replacements,
def runone(options, test, count):
'''returns a result element: (code, test, msg)'''
def skip(msg):
if options.verbose:
log("\nSkipping %s: %s" % (testpath, msg))
return 's', test, msg
- testpath = os.path.join(TESTDIR, test)
- err = os.path.join(TESTDIR, test + ".err")
lctest = test.lower()
for ext, cls, out in testtypes:
if lctest.endswith(ext):
runner = cls
ref = os.path.join(TESTDIR, test + out)
break
else:
return skip("unknown test type")
- t = runner(test, testpath, options, count, ref, err)
+ t = runner(TESTDIR, test, options, count, ref)
result = t.run()
del t # For cleanup side-effects.
return result
_hgpath = None