run-tests: detect HGWITHRUSTEXT value stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 30 Aug 2023 12:24:12 +0200
branchstable
changeset 50932 afb3cccc90f7
parent 50931 a4ec7a92d2c5
child 50933 5a8b54201039
run-tests: detect HGWITHRUSTEXT value Without this, some manual check in tests/test-dirstate.t could get confused by the lack of `rust` in module policy and break the test.
tests/run-tests.py
--- a/tests/run-tests.py	Wed Aug 30 11:31:05 2023 +0100
+++ b/tests/run-tests.py	Wed Aug 30 12:24:12 2023 +0200
@@ -3148,6 +3148,13 @@
         self._custom_bin_dir = os.path.join(self._hgtmp, b'custom-bin')
         os.makedirs(self._custom_bin_dir)
 
+        # detect and enforce an alternative way to specify rust extension usage
+        if (
+            not (self.options.pure or self.options.rust or self.options.no_rust)
+            and os.environ.get("HGWITHRUSTEXT") == "cpython"
+        ):
+            self.options.rust = True
+
         if self.options.with_hg:
             self._installdir = None
             whg = self.options.with_hg