Patchwork D9814: hghave: split apart testing for the curses module and `tic` executable

login
register
mail settings
Submitter phabricator
Date Jan. 18, 2021, 6:45 a.m.
Message ID <differential-rev-PHID-DREV-mwahxowftrskg2b5v3wb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48125/
State Superseded
Headers show

Comments

phabricator - Jan. 18, 2021, 6:45 a.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  ef771d329961 <https://phab.mercurial-scm.org/rHGef771d32996164de2b2a4d3c5853de3ce1677ffc> skipped the check for the `tic` executable, because the curses
  module alone on Windows is enough to pass the `test-*-curses.t` tests.  However,
  `test-status-color.t` uses this same check and explicitly invoked the
  executable, which fails on Windows.  From the cursory searching I did, curses on
  unix requires `tic`, which I assume is why they were tied together in the first
  place.  So this continues to require both to get past the curses guards on non
  Windows platforms.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/hghave.py
  tests/test-commit-interactive-curses.t
  tests/test-revert-interactive-curses.t

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-revert-interactive-curses.t b/tests/test-revert-interactive-curses.t
--- a/tests/test-revert-interactive-curses.t
+++ b/tests/test-revert-interactive-curses.t
@@ -1,4 +1,4 @@ 
-#require tic
+#require curses
 
 Revert interactive tests with the Curses interface
 
diff --git a/tests/test-commit-interactive-curses.t b/tests/test-commit-interactive-curses.t
--- a/tests/test-commit-interactive-curses.t
+++ b/tests/test-commit-interactive-curses.t
@@ -1,4 +1,4 @@ 
-#require tic
+#require curses
 
 Set up a repo
 
diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -702,8 +702,8 @@ 
     return os.path.isdir(os.path.join(t, "..", ".hg"))
 
 
-@check("tic", "terminfo compiler and curses module")
-def has_tic():
+@check("curses", "terminfo compiler and curses module")
+def has_curses():
     try:
         import curses
 
@@ -714,11 +714,17 @@ 
         if os.name == 'nt':
             return True
 
-        return matchoutput('test -x "`which tic`"', br'')
+        return has_tic()
+
     except (ImportError, AttributeError):
         return False
 
 
+@check("tic", "terminfo compiler")
+def has_tic():
+    return matchoutput('test -x "`which tic`"', br'')
+
+
 @check("xz", "xz compression utility")
 def has_xz():
     # When Windows invokes a subprocess in shell mode, it uses `cmd.exe`, which