##// END OF EJS Templates
run-tests.py: add RUNTESTDIR to refer `tests` of Mercurial...
FUJIWARA Katsunori -
r25729:57dfadc4 default
parent child Browse files
Show More
@@ -1801,6 +1801,7 b' class TestRunner(object):'
1801
1801
1802 fileb = _bytespath(__file__)
1802 fileb = _bytespath(__file__)
1803 runtestdir = os.path.abspath(os.path.dirname(fileb))
1803 runtestdir = os.path.abspath(os.path.dirname(fileb))
1804 osenvironb[b'RUNTESTDIR'] = runtestdir
1804 if PYTHON3:
1805 if PYTHON3:
1805 sepb = _bytespath(os.pathsep)
1806 sepb = _bytespath(os.pathsep)
1806 else:
1807 else:
@@ -1835,6 +1836,7 b' class TestRunner(object):'
1835 self._coveragefile = os.path.join(self._testdir, b'.coverage')
1836 self._coveragefile = os.path.join(self._testdir, b'.coverage')
1836
1837
1837 vlog("# Using TESTDIR", self._testdir)
1838 vlog("# Using TESTDIR", self._testdir)
1839 vlog("# Using RUNTESTDIR", osenvironb[b'RUNTESTDIR'])
1838 vlog("# Using HGTMP", self._hgtmp)
1840 vlog("# Using HGTMP", self._hgtmp)
1839 vlog("# Using PATH", os.environ["PATH"])
1841 vlog("# Using PATH", os.environ["PATH"])
1840 vlog("# Using", IMPL_PATH, osenvironb[IMPL_PATH])
1842 vlog("# Using", IMPL_PATH, osenvironb[IMPL_PATH])
@@ -583,3 +583,22 b' Mercurial source tree.'
583 $ run-tests.py test-hghave.t
583 $ run-tests.py test-hghave.t
584 .
584 .
585 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
585 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
586
587 test that RUNTESTDIR refers the directory, in which `run-tests.py` now
588 running is placed.
589
590 $ cat > test-runtestdir.t <<EOF
591 > - $TESTDIR, in which test-run-tests.t is placed
592 > - \$TESTDIR, in which test-runtestdir.t is placed (expanded at runtime)
593 > - \$RUNTESTDIR, in which run-tests.py is placed (expanded at runtime)
594 >
595 > $ test "\$TESTDIR" = "$TESTTMP"/anothertests
596 > $ test "\$RUNTESTDIR" = "$TESTDIR"
597 > $ head -n 3 "\$RUNTESTDIR"/../contrib/check-code.py
598 > #!/usr/bin/env python
599 > #
600 > # check-code - a style and portability checker for Mercurial
601 > EOF
602 $ run-tests.py test-runtestdir.t
603 .
604 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
General Comments 0
You need to be logged in to leave comments. Login now