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
--- 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