hghave: add "chg" flag to skip tests that can't be compatible with chg
authorYuya Nishihara <yuya@tcha.org>
Sun, 20 Mar 2016 14:55:56 -0700
changeset 28880 f74eed3115fd
parent 28879 8c1759a2bdf4
child 28881 d9f7f590f1e3
hghave: add "chg" flag to skip tests that can't be compatible with chg Several tests fail with chg for several reasons such as loaded chgserver extension, running uisetup() per server instead of per runcommand, etc. Since these tests can't/shouldn't be changed to be chg friendly, we need a flag to skip them. This patch explicitly drops CHGHG environment if chg isn't involved. This way, hghave can just check if CHGHG exists.
tests/hghave.py
tests/run-tests.py
--- a/tests/hghave.py	Wed Apr 06 19:09:12 2016 +0000
+++ b/tests/hghave.py	Sun Mar 20 14:55:56 2016 -0700
@@ -124,6 +124,10 @@
     except ImportError:
         return False
 
+@check("chg", "running with chg")
+def has_chg():
+    return 'CHGHG' in os.environ
+
 @check("cvs", "cvs client/server")
 def has_cvs():
     re = r'Concurrent Versions System.*?server'
--- a/tests/run-tests.py	Wed Apr 06 19:09:12 2016 +0000
+++ b/tests/run-tests.py	Sun Mar 20 14:55:56 2016 -0700
@@ -2064,6 +2064,8 @@
         chgbindir = self._bindir
         if self.options.chg or self.options.with_chg:
             osenvironb[b'CHGHG'] = os.path.join(self._bindir, self._hgcommand)
+        else:
+            osenvironb.pop(b'CHGHG', None)  # drop flag for hghave
         if self.options.chg:
             self._hgcommand = b'chg'
         elif self.options.with_chg: