# HG changeset patch # User Matt Harbison # Date 2021-01-18 03:25:15 # Node ID e5e6282fa66a2fba27b74c67996ff4900c5ea811 # Parent 9c35267f01e0626aa7a3bf32b6950dd7fd97ac48 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 diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -702,8 +702,8 @@ def has_test_repo(): 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 @@ def has_tic(): 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 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/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