bug-automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: failure in "colorful tests"


From: Ralf Wildenhues
Subject: Re: failure in "colorful tests"
Date: Tue, 13 Nov 2007 22:58:26 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

* 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 'hi' # 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 <address@hidden>
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  <address@hidden>
+
+       Fix color test failure on dumb (and other) terminals.
+       * tests/color.test: Set TERM to `ansi'.
+
 2007-11-12  Ralf Wildenhues  <address@hidden>
 
        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=''
 grn=''
 lgn=''




reply via email to

[Prev in Thread] Current Thread [Next in Thread]