bug-automake
[Top][All Lists]
Advanced

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

Re: automake results on OpenBSD 4.0


From: Eric Blake
Subject: Re: automake results on OpenBSD 4.0
Date: Wed, 23 Jan 2008 17:05:29 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Eric Blake <ebb9 <at> byu.net> writes:

> | Can you post output of the following please?
> |   cd tests && TESTS=color.test VERBOSE=yes make -e check
> 
> Colors correctly displayed (at least via my rxvt terminal hosting the ssh
> session to the machine in question).  I used the BSD make.

More importantly, I used BSD grep, and I've isolated the problem:

$ FGREP=fgrep
$ grep ': pass' stdout
Binary file stdout matches
$ grep -a ': pass' stdout
PASS: pass
$ cat stdout | grep ': pass'
PASS: pass


Since the file stdout contains terminal escape sequences, BSD grep refuses to 
parse it.  What's even weirder, when the same contents come via a pipe, BSD 
grep works just fine.  I'm not sure if grep -a is portable (POSIX doesn't 
require it), so is the following patch appropriate (and should we also mention 
this in the autoconf manual)?  The tail of the verbose test run now reports:

+ test_color
PASS: pass
FAIL: fail
XFAIL: xfail
XPASS: xpass
SKIP: skip
+ expect -f expect-make
+ > stdout 
+ MAKE=make
./color.test[102]: expect: not found
+ exit 77
+ exit_status=77
+ cd /home/ericb/automake/tests
+ test 0 != 0
+ echo : exit 77
: exit 77
+ exit 77
SKIP: color.test
======================
All 0 tests passed
(1 tests were not run)
======================

and if I were to install expect, I assume the entire test would pass.

>From df018a2c439e064028d0ad6a8b74e40754dbb9f7 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Wed, 23 Jan 2008 10:03:58 -0700
Subject: [PATCH] Fix color.test when using BSD grep.

* tests/color.test: Ensure that grep can handle non-printing
characters.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog        |    6 ++++++
 tests/color.test |   27 +++++++++++++++++----------
 2 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 605dd92..649e9ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-23  Eric Blake  <address@hidden>
+
+       Fix color.test when using BSD grep.
+       * tests/color.test: Ensure that grep can handle non-printing
+       characters.
+
 2008-01-23  Ralf Wildenhues  <address@hidden>
 
        * tests/lisp3.test: Fix typo.
diff --git a/tests/color.test b/tests/color.test
index 5b51287..bb4431c 100755
--- a/tests/color.test
+++ b/tests/color.test
@@ -29,6 +29,13 @@ lgn=''
 blu=''
 std=''
 
+# Check that grep can parse nonprinting characters
+# BSD grep can do so from a pipe, but not a file.
+case `echo "$std" | grep .` in
+  $std) ;;
+  *) exit 77 ;;
+esac
+
 cat >>configure.in <<END
 AC_OUTPUT
 END
@@ -66,20 +73,20 @@ $AUTOCONF
 
 test_color ()
 {
-  grep ": pass" stdout | $FGREP "$grn"
-  grep ": fail" stdout | $FGREP "$red"
-  grep ": xfail" stdout | $FGREP "$lgn"
-  grep ": xpass" stdout | $FGREP "$red"
-  grep ": skip" stdout | $FGREP "$blu"
+  cat stdout | grep ": pass" | $FGREP "$grn"
+  cat stdout | grep ": fail" | $FGREP "$red"
+  cat stdout | grep ": xfail" | $FGREP "$lgn"
+  cat stdout | grep ": xpass" | $FGREP "$red"
+  cat stdout | grep ": skip" | $FGREP "$blu"
 }
 
 test_no_color ()
 {
-  grep ": pass" stdout | $FGREP "$grn" && exit 1
-  grep ": fail" stdout | $FGREP "$red" && exit 1
-  grep ": xfail" stdout | $FGREP "$lgn" && exit 1
-  grep ": xpass" stdout | $FGREP "$red" && exit 1
-  grep ": skip" stdout | $FGREP "$blu" && exit 1
+  cat stdout | grep ": pass" | $FGREP "$grn" && exit 1
+  cat stdout | grep ": fail" | $FGREP "$red" && exit 1
+  cat stdout | grep ": xfail" | $FGREP "$lgn" && exit 1
+  cat stdout | grep ": xpass" | $FGREP "$red" && exit 1
+  cat stdout | grep ": skip" | $FGREP "$blu" && exit 1
   :
 }
 
-- 
1.5.3.8








reply via email to

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