tests/run-tests.py
changeset 23859 661b246bf1c4
parent 23728 31d3f973d079
child 23933 769027075e21
equal deleted inserted replaced
23858:22a979d1ae56 23859:661b246bf1c4
  1642             self._pythondir = os.path.join(self._installdir, "lib", "python")
  1642             self._pythondir = os.path.join(self._installdir, "lib", "python")
  1643 
  1643 
  1644         os.environ["BINDIR"] = self._bindir
  1644         os.environ["BINDIR"] = self._bindir
  1645         os.environ["PYTHON"] = PYTHON
  1645         os.environ["PYTHON"] = PYTHON
  1646 
  1646 
  1647         path = [self._bindir] + os.environ["PATH"].split(os.pathsep)
  1647         runtestdir = os.path.abspath(os.path.dirname(__file__))
       
  1648         path = [self._bindir, runtestdir] + os.environ["PATH"].split(os.pathsep)
  1648         if self._tmpbindir != self._bindir:
  1649         if self._tmpbindir != self._bindir:
  1649             path = [self._tmpbindir] + path
  1650             path = [self._tmpbindir] + path
  1650         os.environ["PATH"] = os.pathsep.join(path)
  1651         os.environ["PATH"] = os.pathsep.join(path)
  1651 
  1652 
  1652         # Include TESTDIR in PYTHONPATH so that out-of-tree extensions
  1653         # Include TESTDIR in PYTHONPATH so that out-of-tree extensions
  1653         # can run .../tests/run-tests.py test-foo where test-foo
  1654         # can run .../tests/run-tests.py test-foo where test-foo
  1654         # adds an extension to HGRC. Also include run-test.py directory to
  1655         # adds an extension to HGRC. Also include run-test.py directory to
  1655         # import modules like heredoctest.
  1656         # import modules like heredoctest.
  1656         pypath = [self._pythondir, self._testdir,
  1657         pypath = [self._pythondir, self._testdir, runtestdir]
  1657                   os.path.abspath(os.path.dirname(__file__))]
       
  1658         # We have to augment PYTHONPATH, rather than simply replacing
  1658         # We have to augment PYTHONPATH, rather than simply replacing
  1659         # it, in case external libraries are only available via current
  1659         # it, in case external libraries are only available via current
  1660         # PYTHONPATH.  (In particular, the Subversion bindings on OS X
  1660         # PYTHONPATH.  (In particular, the Subversion bindings on OS X
  1661         # are in /opt/subversion.)
  1661         # are in /opt/subversion.)
  1662         oldpypath = os.environ.get(IMPL_PATH)
  1662         oldpypath = os.environ.get(IMPL_PATH)