hghave: split apart testing for the curses module and `tic` executable
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 17 Jan 2021 22:25:15 -0500
changeset 46325 e5e6282fa66a
parent 46324 9c35267f01e0
child 46326 3e23794b9e1c
hghave: split apart testing for the curses module and `tic` executable ef771d329961 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. Differential Revision: https://phab.mercurial-scm.org/D9814
tests/hghave.py
tests/test-commit-interactive-curses.t
tests/test-revert-interactive-curses.t
--- a/tests/hghave.py	Mon Jan 18 13:59:54 2021 +0100
+++ b/tests/hghave.py	Sun Jan 17 22:25:15 2021 -0500
@@ -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
--- a/tests/test-commit-interactive-curses.t	Mon Jan 18 13:59:54 2021 +0100
+++ b/tests/test-commit-interactive-curses.t	Sun Jan 17 22:25:15 2021 -0500
@@ -1,4 +1,4 @@
-#require tic
+#require curses
 
 Set up a repo
 
--- a/tests/test-revert-interactive-curses.t	Mon Jan 18 13:59:54 2021 +0100
+++ b/tests/test-revert-interactive-curses.t	Sun Jan 17 22:25:15 2021 -0500
@@ -1,4 +1,4 @@
-#require tic
+#require curses
 
 Revert interactive tests with the Curses interface