diff tests/run-tests.py @ 25729:57dfadc4f46c

run-tests.py: add RUNTESTDIR to refer `tests` of Mercurial Before this patch, there is no way to refer files under `tests` or so of Mercurial source tree, when `run-tests.py` runs in `tests` of third party tools. In this case, `TESTDIR` refers the latter `tests`. This prevents third party tools from using useful tools in Mercurial source tree (e.g. `contrib/check-code.py`). This patch adds `RUNTESTDIR` environment variable to refer `tests` of Mercurial source tree, in which `run-tests.py` now running is placed. For example, tests of third party tools can refer `contrib/check-code.py` in Mercurial source tree as `$RUNTESTDIR/../contrib/check-code.py`. BTW, for similarity with `TESTDIR` referring `test*s*` directory, newly added environment variable isn't named as `RUNTEST*S*DIR`. In addition to it, the corresponded local variable is also named as `runtestdir`. 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 905c32321cfb
children c380d5273e91
line wrap: on
line diff
--- a/tests/run-tests.py	Fri Jul 03 06:56:03 2015 +0900
+++ b/tests/run-tests.py	Fri Jul 03 06:56:03 2015 +0900
@@ -1801,6 +1801,7 @@
 
         fileb = _bytespath(__file__)
         runtestdir = os.path.abspath(os.path.dirname(fileb))
+        osenvironb[b'RUNTESTDIR'] = runtestdir
         if PYTHON3:
             sepb = _bytespath(os.pathsep)
         else:
@@ -1835,6 +1836,7 @@
         self._coveragefile = os.path.join(self._testdir, b'.coverage')
 
         vlog("# Using TESTDIR", self._testdir)
+        vlog("# Using RUNTESTDIR", osenvironb[b'RUNTESTDIR'])
         vlog("# Using HGTMP", self._hgtmp)
         vlog("# Using PATH", os.environ["PATH"])
         vlog("# Using", IMPL_PATH, osenvironb[IMPL_PATH])