changeset 23935:d64dd1252386 stable

run-tests.py: inherit --pure option from outer run-tests.py execution Before this patch, "test-run-tests.t" doesn't test "run-tests.py" with "--pure", even if outer "run-tests.py" is executed with it. This patch uses not "HG_RUN_TESTS_PURE" but "HGTEST_RUN_TESTS_PURE", because "HG_" prefixed environments are forcibly dropped in "_getenv()". This is also useful to run "run-tests.py" successfully by "run-tests.py --pure" on Windows without any compilation tools (like VisualStudio).
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Thu, 22 Jan 2015 00:07:06 +0900
parents 975c4fc4a512
children 30b016ef4bd8
files tests/run-tests.py tests/test-run-tests.t
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Thu Jan 22 00:07:06 2015 +0900
+++ b/tests/run-tests.py	Thu Jan 22 00:07:06 2015 +0900
@@ -1664,6 +1664,9 @@
             pypath.append(oldpypath)
         os.environ[IMPL_PATH] = os.pathsep.join(pypath)
 
+        if self.options.pure:
+            os.environ["HGTEST_RUN_TESTS_PURE"] = "--pure"
+
         self._coveragefile = os.path.join(self._testdir, '.coverage')
 
         vlog("# Using TESTDIR", self._testdir)
--- a/tests/test-run-tests.t	Thu Jan 22 00:07:06 2015 +0900
+++ b/tests/test-run-tests.t	Thu Jan 22 00:07:06 2015 +0900
@@ -3,7 +3,7 @@
 Smoke test
 ============
 
-  $ $TESTDIR/run-tests.py
+  $ $TESTDIR/run-tests.py $HGTEST_RUN_TESTS_PURE
   
   # Ran 0 tests, 0 skipped, 0 warned, 0 failed.