]> git.ipfire.org Git - thirdparty/git.git/blame - t/lib-terminal.sh
Merge branch 'jk/complete-commit-c' into maint
[thirdparty/git.git] / t / lib-terminal.sh
CommitLineData
cc4e48fc
JK
1#!/bin/sh
2
339e5638
JN
3test_expect_success PERL 'set up terminal for tests' '
4 # Reading from the pty master seems to get stuck _sometimes_
5 # on Mac OS X 10.5.0, using Perl 5.10.0 or 5.8.9.
6 #
7 # Reproduction recipe: run
8 #
9 # i=0
10 # while ./test-terminal.perl echo hi $i
11 # do
12 # : $((i = $i + 1))
13 # done
14 #
15 # After 2000 iterations or so it hangs.
16 # https://rt.cpan.org/Ticket/Display.html?id=65692
17 #
18 if test "$(uname -s)" = Darwin
19 then
20 :
21 elif
cc4e48fc 22 "$PERL_PATH" "$TEST_DIRECTORY"/test-terminal.perl \
e23f436c 23 sh -c "test -t 1 && test -t 2"
cc4e48fc 24 then
e674c17d
JN
25 test_set_prereq TTY &&
26 test_terminal () {
27 if ! test_declared_prereq TTY
28 then
29 echo >&4 "test_terminal: need to declare TTY prerequisite"
30 return 127
31 fi
32 "$PERL_PATH" "$TEST_DIRECTORY"/test-terminal.perl "$@"
33 }
cc4e48fc
JK
34 fi
35'