[Updated] D11049: run-tests: introduce a `HGTEST_REAL_HG` variable for test

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Tue Jul 13 16:27:56 UTC 2021


Closed by commit rHG7f7f57ceffa6: run-tests: introduce a `HGTEST_REAL_HG` variable for test (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11049?vs=29136&id=29222

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11049/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11049

AFFECTED FILES
  tests/run-tests.py
  tests/test-hghave.t
  tests/test-run-tests.t

CHANGE DETAILS

diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -15,7 +15,7 @@
 =============
   $ rt()
   > {
-  >     "$PYTHON" $TESTDIR/run-tests.py --with-hg=`which hg` -j1 "$@"
+  >     "$PYTHON" $TESTDIR/run-tests.py --with-hg=$HGTEST_REAL_HG -j1 "$@"
   > }
 
 error paths
@@ -1369,7 +1369,7 @@
 Add support for external test formatter
 =======================================
 
-  $ CUSTOM_TEST_RESULT=basic_test_result "$PYTHON" $TESTDIR/run-tests.py --with-hg=`which hg` -j1 "$@" test-success.t test-failure.t
+  $ CUSTOM_TEST_RESULT=basic_test_result "$PYTHON" $TESTDIR/run-tests.py --with-hg=$HGTEST_REAL_HG -j1 "$@" test-success.t test-failure.t
   running 2 tests using 1 parallel processes 
   
   # Ran 2 tests, 0 skipped, 0 failed.
diff --git a/tests/test-hghave.t b/tests/test-hghave.t
--- a/tests/test-hghave.t
+++ b/tests/test-hghave.t
@@ -22,7 +22,7 @@
   > EOF
   $ ( \
   > testrepohgenv; \
-  > "$PYTHON" $TESTDIR/run-tests.py --with-hg=`which hg` -j 1 \
+  > "$PYTHON" $TESTDIR/run-tests.py --with-hg=$HGTEST_REAL_HG -j 1 \
   >    $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t \
   > )
   running 1 tests using 1 parallel processes 
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -3160,10 +3160,13 @@
         if WINDOWS and not self._hgcommand.endswith(b'.exe'):
             self._hgcommand += b'.exe'
 
+        real_hg = os.path.join(self._bindir, self._hgcommand)
+        assert real_hg is not None
+        osenvironb[b'HGTEST_REAL_HG'] = real_hg
         # set CHGHG, then replace "hg" command by "chg"
         chgbindir = self._bindir
         if self.options.chg or self.options.with_chg:
-            osenvironb[b'CHGHG'] = os.path.join(self._bindir, self._hgcommand)
+            osenvironb[b'CHGHG'] = real_hg
         else:
             osenvironb.pop(b'CHGHG', None)  # drop flag for hghave
         if self.options.chg:
@@ -3182,9 +3185,7 @@
             # `--config` but that disrupts tests that print command lines and check expected
             # output.
             osenvironb[b'RHG_ON_UNSUPPORTED'] = b'fallback'
-            osenvironb[b'RHG_FALLBACK_EXECUTABLE'] = os.path.join(
-                self._bindir, self._hgcommand
-            )
+            osenvironb[b'RHG_FALLBACK_EXECUTABLE'] = real_hg
         if self.options.rhg:
             self._hgcommand = b'rhg'
         elif self.options.with_rhg:



To: marmoute, #hg-reviewers
Cc: Alphare, mharbison72, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210713/a445cb25/attachment-0002.html>


More information about the Mercurial-patches mailing list