]> git.ipfire.org Git - thirdparty/git.git/commitdiff
test-lib: skip test with COLUMNS=1 under mksh
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 27 Apr 2012 09:25:25 +0000 (11:25 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Apr 2012 16:26:37 +0000 (09:26 -0700)
mksh does not allow $COLUMNS to be set below 12.  mksh(1) says that
$COLUMNS is "always set, defaults to 80, unless the value as reported
by stty(1) is non-zero and sane enough". This applies also to setting
it directly for one command:

    $ COLUMNS=10 python -c 'import os; print os.environ["COLUMNS"]'
    98

Add a test prerequisite by checking if we can set COLUMNS=1, to allow
us to skip tests that needs it.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh

index d75766adaf127bbe77022da4ba1e2af1fbdff878..50a01b1c1d75f20cde4ba4b14c5fc451d783b045 100644 (file)
@@ -614,6 +614,7 @@ case $(uname -s) in
        ;;
 esac
 
+( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PYTHON" && test_set_prereq PYTHON
 test -n "$USE_LIBPCRE" && test_set_prereq LIBPCRE