comparison tests/run-tests.py @ 25730:c380d5273e91

run-tests.py: add TESTDIR to PATH if it differs from RUNTESTDIR Before this patch, `RUNTESTDIR` is added to `PATH`, but `TESTDIR` isn't. This doesn't cause any problems, if `run-tests.py` runs in `tests` directory of Mercurial source tree. In this case, `RUNTESTDIR` should be equal to `TESTDIR`. On the other hand, if `run-tests.py` runs in `tests` of third party tools, commands in that directory should be executed with explicit `$TESTDIR/` prefix in `*.t` test scripts. This isn't suitable for the policy "drop explicit $TESTDIR from executables" of Mercurial itself (see 4d2b9b304ad0). BTW, 4d2b9b304ad0 describes that "$TESTDIR is added to the path" even though `TESTDIR` isn't added to `PATH` exactly speaking, because `TESTDIR` and `RUNTESTDIR` weren't yet distinguished from each other at that time. 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 57dfadc4f46c
children 06cd67a5044f
comparison
equal deleted inserted replaced
25729:57dfadc4f46c 25730:c380d5273e91
1810 if os.path.islink(__file__): 1810 if os.path.islink(__file__):
1811 # test helper will likely be at the end of the symlink 1811 # test helper will likely be at the end of the symlink
1812 realfile = os.path.realpath(fileb) 1812 realfile = os.path.realpath(fileb)
1813 realdir = os.path.abspath(os.path.dirname(realfile)) 1813 realdir = os.path.abspath(os.path.dirname(realfile))
1814 path.insert(2, realdir) 1814 path.insert(2, realdir)
1815 if self._testdir != runtestdir:
1816 path = [self._testdir] + path
1815 if self._tmpbindir != self._bindir: 1817 if self._tmpbindir != self._bindir:
1816 path = [self._tmpbindir] + path 1818 path = [self._tmpbindir] + path
1817 osenvironb[b"PATH"] = sepb.join(path) 1819 osenvironb[b"PATH"] = sepb.join(path)
1818 1820
1819 # Include TESTDIR in PYTHONPATH so that out-of-tree extensions 1821 # Include TESTDIR in PYTHONPATH so that out-of-tree extensions