700 def has_test_repo(): |
700 def has_test_repo(): |
701 t = os.environ["TESTDIR"] |
701 t = os.environ["TESTDIR"] |
702 return os.path.isdir(os.path.join(t, "..", ".hg")) |
702 return os.path.isdir(os.path.join(t, "..", ".hg")) |
703 |
703 |
704 |
704 |
705 @check("tic", "terminfo compiler and curses module") |
705 @check("curses", "terminfo compiler and curses module") |
706 def has_tic(): |
706 def has_curses(): |
707 try: |
707 try: |
708 import curses |
708 import curses |
709 |
709 |
710 curses.COLOR_BLUE |
710 curses.COLOR_BLUE |
711 |
711 |
712 # Windows doesn't have a `tic` executable, but the windows_curses |
712 # Windows doesn't have a `tic` executable, but the windows_curses |
713 # package is sufficient to run the tests without it. |
713 # package is sufficient to run the tests without it. |
714 if os.name == 'nt': |
714 if os.name == 'nt': |
715 return True |
715 return True |
716 |
716 |
717 return matchoutput('test -x "`which tic`"', br'') |
717 return has_tic() |
|
718 |
718 except (ImportError, AttributeError): |
719 except (ImportError, AttributeError): |
719 return False |
720 return False |
|
721 |
|
722 |
|
723 @check("tic", "terminfo compiler") |
|
724 def has_tic(): |
|
725 return matchoutput('test -x "`which tic`"', br'') |
720 |
726 |
721 |
727 |
722 @check("xz", "xz compression utility") |
728 @check("xz", "xz compression utility") |
723 def has_xz(): |
729 def has_xz(): |
724 # When Windows invokes a subprocess in shell mode, it uses `cmd.exe`, which |
730 # When Windows invokes a subprocess in shell mode, it uses `cmd.exe`, which |