# HG changeset patch # User Mads Kiilerich # Date 2015-01-14 00:15:26 # Node ID 661b246bf1c4f43898ec6ba92b7e7bc6f20e3abd # Parent 22a979d1ae569d1cd87f166b5600def0fe93efb3 run-tests: include testdir in $PATH so tests easily can use helper tools The testdir is already added to $PYTHONPATH - I think it makes sense and is convenient to add it to $PATH too. The following binaries are invoked from tests using full path with $TESTDIR/ - they can now be used without specifying path: dumbhttp.py dummyssh filterpyflakes.py generate-working-copy-states.py get-with-headers.py hghave histedit-helpers.sh killdaemons.py md5sum.py notcapable printenv.py readlink.py revlog-formatv0.py run-tests.py svn-safe-append.py svnxml.py tinyproxy.py diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1644,7 +1644,8 @@ class TestRunner(object): os.environ["BINDIR"] = self._bindir os.environ["PYTHON"] = PYTHON - path = [self._bindir] + os.environ["PATH"].split(os.pathsep) + runtestdir = os.path.abspath(os.path.dirname(__file__)) + path = [self._bindir, runtestdir] + os.environ["PATH"].split(os.pathsep) if self._tmpbindir != self._bindir: path = [self._tmpbindir] + path os.environ["PATH"] = os.pathsep.join(path) @@ -1653,8 +1654,7 @@ class TestRunner(object): # can run .../tests/run-tests.py test-foo where test-foo # adds an extension to HGRC. Also include run-test.py directory to # import modules like heredoctest. - pypath = [self._pythondir, self._testdir, - os.path.abspath(os.path.dirname(__file__))] + pypath = [self._pythondir, self._testdir, runtestdir] # We have to augment PYTHONPATH, rather than simply replacing # it, in case external libraries are only available via current # PYTHONPATH. (In particular, the Subversion bindings on OS X