comparison tests/run-tests.py @ 25728:905c32321cfb

run-tests.py: execute hghave by the path relative to run-tests.py Before this patch, `run-tests.py` executes `hghave` by the path relative to `TESTDIR` (= cwd of `run-tests.py` running). This prevents third party tools for Mercurial from running `run-tests.py`, which is placed in `tests` of Mercurial source tree, in `tests` of own source tree. In such cases, `TESTDIR` refers the latter `tests`, and `hghave` doesn't exist in it. This is a one of preparations for issue4677.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 03 Jul 2015 06:56:03 +0900
parents 6025cac3d02f
children 57dfadc4f46c
comparison
equal deleted inserted replaced
25727:b8245386ab40 25728:905c32321cfb
900 900
901 return self._processoutput(exitcode, output, salt, after, expected) 901 return self._processoutput(exitcode, output, salt, after, expected)
902 902
903 def _hghave(self, reqs): 903 def _hghave(self, reqs):
904 # TODO do something smarter when all other uses of hghave are gone. 904 # TODO do something smarter when all other uses of hghave are gone.
905 tdir = self._testdir.replace(b'\\', b'/') 905 runtestdir = os.path.abspath(os.path.dirname(_bytespath(__file__)))
906 tdir = runtestdir.replace(b'\\', b'/')
906 proc = Popen4(b'%s -c "%s/hghave %s"' % 907 proc = Popen4(b'%s -c "%s/hghave %s"' %
907 (self._shell, tdir, b' '.join(reqs)), 908 (self._shell, tdir, b' '.join(reqs)),
908 self._testtmp, 0, self._getenv()) 909 self._testtmp, 0, self._getenv())
909 stdout, stderr = proc.communicate() 910 stdout, stderr = proc.communicate()
910 ret = proc.wait() 911 ret = proc.wait()