* Bob Proulx wrote on Tue, Nov 13, 2007 at 12:41:01AM CET: > Ralf Wildenhues wrote: > > +case $TERM in > > +dumb) exit 77;; > > +esac > > ... > > Thanks! Do we need to guard against other TERM settings, too? > > Hmm... I was thinking more along the lines of this patch instead. I > don't think the test should be skipped. I think it should be made > independent of the invoking user's TERM. Because the test is > self-contained it does not depend upon the user's TERM setting.
Agreed. Thanks. I've applied the patch below. > In fact I think it is required because ansi escape sequences were > coded into the script. That means if this is run on a non-ansi > terminal it would fail. Yes, makes sense. > [This dependence upon TERM but the assumption of ansi escape sequences > in the test may account for tput "failures" on non-ansi terminals that > you reported during development. (shrug) Not sure but it seems > plausible to me.] Not really. I simply went ahead and ssh'ed into some systems and tried the following: ( tput setaf 1; echo hi; tput sgr0 ) # 1 ( TERM=ansi; export TERM; tput setaf 1; echo hi; tput sgr0 ) # 2 echo '[0;31mhi[m' # 3 With the first line, TERM was xterm. Plus is where I got color, minus is no color, X is error: | tput: Unknown terminfo capability `1' system 1 2 3 --------------------------------- AIX 4.3 - - + AIX 5.3 - - + Darwin 8.9.0 - + + FreeBSD 6.2 - - + GNU/Linux + + + HP-UX 10.20 - - + HP-UX 11.23 - - + IRIX 6.5 - - + OpenBSD 4.0 X + + Solaris 10 + - + Solaris 2.6 - - + Tru64 4.0D + - + Tru64 5.1 + - + The results looked pretty convincing to me. But hey, if you can show me what setup ANSI escape sequences break, then I'm all ears. Cheers, Ralf commit d826333beefa170835b20612332be837624f72c1 Author: Bob Proulx <[EMAIL PROTECTED]> Date: Tue Nov 13 22:57:15 2007 +0100 Fix color test failure on dumb (and other) terminals. * tests/color.test: Set TERM to `ansi'. diff --git a/ChangeLog b/ChangeLog index f02f870..c80196c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-11-13 Bob Proulx <[EMAIL PROTECTED]> + + Fix color test failure on dumb (and other) terminals. + * tests/color.test: Set TERM to `ansi'. + 2007-11-12 Ralf Wildenhues <[EMAIL PROTECTED]> Avoid spurious test failure with `make check TESTS=check5.test'. diff --git a/tests/color.test b/tests/color.test index d30d1e0..8d6520d 100755 --- a/tests/color.test +++ b/tests/color.test @@ -24,6 +24,9 @@ set -e +TERM=ansi +export TERM + red='[0;31m' grn='[0;32m' lgn='[1;32m'