Mercurial > hg
changeset 46325:e5e6282fa66a
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
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 17 Jan 2021 22:25:15 -0500 |
parents | 9c35267f01e0 |
children | 3e23794b9e1c |
files | tests/hghave.py tests/test-commit-interactive-curses.t tests/test-revert-interactive-curses.t |
diffstat | 3 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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