diff options
author | Alain Magloire <alainm@rcsm.ee.mcgill.ca> | 1999-03-07 03:12:18 +0000 |
---|---|---|
committer | Alain Magloire <alainm@rcsm.ee.mcgill.ca> | 1999-03-07 03:12:18 +0000 |
commit | af7c52a1fd0b3f9aac1fe560c021551697dae6ef (patch) | |
tree | 50fa7ea1ef04bf376af1ce7eea0046a8e66f75d7 /tests/bre.awk | |
parent | 2fa4d7a64f9e3de7bc37a3e380cec060e2fb6b1d (diff) | |
download | grep-af7c52a1fd0b3f9aac1fe560c021551697dae6ef.tar.gz |
changes for tests scripts.
typos.
Chnages from Andreas.
* tests/*.awk : Linux users are seeing "Broken Pipe" on make check.
The problem is that grep does not drain its stdin, thus the previous
process in the pipeline receives a SIGPIPE. Other shells are silent
about this. There is actually no failure, since the broken pipe is
expected. You can work around it by changing the pipeline, so that
the input is drained, like this:
status=`echo 'check' | { ${GREP} -E -e pattern >/dev/null 2>&1;
echo $?; cat >/dev/null; }`; if test $status -ne $errnu then ... fi
Excerpt from email exchange with Andreas Schwab.
Diffstat (limited to 'tests/bre.awk')
-rw-r--r-- | tests/bre.awk | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/bre.awk b/tests/bre.awk index 39730713..5d68e0cb 100644 --- a/tests/bre.awk +++ b/tests/bre.awk @@ -8,8 +8,8 @@ BEGIN { $0 ~ /^#/ { next; } NF == 3 { - printf ("echo '%s' | ${GREP} -e '%s' > /dev/null 2>&1\n",$3, $2); - printf ("if test $? -ne %s ; then\n", $1); + printf ("status=`echo '%s' | { ${GREP} -e '%s' > /dev/null 2>&1; echo $?; cat >/dev/null; }\n",$3, $2); + printf ("if test $status -ne %s ; then\n", $1); printf ("\techo Spencer bre test \\#%d failed\n", ++n); printf ("\tfailures=1\n"); printf ("fi\n"); |