]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/lib-terminal.sh
tests: test terminal output to both stdout and stderr
[thirdparty/git.git] / t / lib-terminal.sh
index 6fc33db6c14ffaa25e8b086a563be5f7b3829949..3258b8f0d5c36e0450ac5421b39b1ff4b3c379d0 100644 (file)
@@ -1,19 +1,19 @@
 #!/bin/sh
 
 test_expect_success 'set up terminal for tests' '
-       if test -t 1
+       if test -t 1 && test -t 2
        then
-               >stdout_is_tty
+               >have_tty
        elif
                test_have_prereq PERL &&
                "$PERL_PATH" "$TEST_DIRECTORY"/test-terminal.perl \
-                       sh -c "test -t 1"
+                       sh -c "test -t 1 && test -t 2"
        then
                >test_terminal_works
        fi
 '
 
-if test -e stdout_is_tty
+if test -e have_tty
 then
        test_terminal() { "$@"; }
        test_set_prereq TTY