Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/lib-terminal.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / lib-terminal.sh` 36 lines ยท 945 bytes Raw Blame History 1 # Helpers for terminal output tests. 2 3 # Catch tests which should depend on TTY but forgot to. There's no need 4 # to additionally check that the TTY prereq is set here. If the test declared 5 # it and we are running the test, then it must have been set. 6 test_terminal () { 7 if ! test_declared_prereq TTY 8 then 9 echo >&4 "test_terminal: need to declare TTY prerequisite" 10 return 127 11 fi 12 perl "$TEST_DIRECTORY"/test-terminal.perl "$@" 2>&7 13 } 7>&2 2>&4 14 15 test_lazy_prereq TTY ' 16 test_have_prereq PERL && 17 18 # Reading from the pty master seems to get stuck _sometimes_ 19 # on Mac OS X 10.5.0, using Perl 5.10.0 or 5.8.9. 20 # 21 # Reproduction recipe: run 22 # 23 # i=0 24 # while ./test-terminal.perl echo hi $i 25 # do 26 # : $((i = $i + 1)) 27 # done 28 # 29 # After 2000 iterations or so it hangs. 30 # https://rt.cpan.org/Ticket/Display.html?id=65692 31 # 32 test "$(uname -s)" != Darwin && 33 34 perl "$TEST_DIRECTORY"/test-terminal.perl \ 35 sh -c "test -t 1 && test -t 2" 36 '