changeset 23859:661b246bf1c4

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
author Mads Kiilerich <madski@unity3d.com>
date Wed, 14 Jan 2015 01:15:26 +0100
parents 22a979d1ae56
children bead0c7b4f68
files tests/run-tests.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Mon Jan 12 15:29:36 2015 -0500
+++ b/tests/run-tests.py	Wed Jan 14 01:15:26 2015 +0100
@@ -1644,7 +1644,8 @@
         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 @@
         # 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