summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlain Magloire <alainm@rcsm.ee.mcgill.ca>1999-03-07 03:12:18 +0000
committerAlain Magloire <alainm@rcsm.ee.mcgill.ca>1999-03-07 03:12:18 +0000
commitaf7c52a1fd0b3f9aac1fe560c021551697dae6ef (patch)
tree50fa7ea1ef04bf376af1ce7eea0046a8e66f75d7 /tests
parent2fa4d7a64f9e3de7bc37a3e380cec060e2fb6b1d (diff)
downloadgrep-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')
-rw-r--r--tests/bre.awk4
-rw-r--r--tests/ere.awk4
-rw-r--r--tests/spencer1.awk4
3 files changed, 6 insertions, 6 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");
diff --git a/tests/ere.awk b/tests/ere.awk
index c014fe9a..68a157c7 100644
--- a/tests/ere.awk
+++ b/tests/ere.awk
@@ -8,8 +8,8 @@ BEGIN {
$0 ~ /^#/ { next; }
NF == 3 {
- printf ("echo '%s' | ${GREP} -E -e '%s' > /dev/null 2>&1\n",$3, $2);
- printf ("if test $? -ne %s ; then\n", $1);
+ printf ("status=`echo '%s' | { ${GREP} -E -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 ere test \\#%d failed\n", ++n);
printf ("\tfailures=1\n");
printf ("fi\n");
diff --git a/tests/spencer1.awk b/tests/spencer1.awk
index b4d9b1c4..00df0f9c 100644
--- a/tests/spencer1.awk
+++ b/tests/spencer1.awk
@@ -4,8 +4,8 @@ BEGIN {
}
$0 !~ /^#/ && NF = 3 {
- printf ("echo '%s'| ${GREP} -E -e '%s' > /dev/null 2>&1\n",$3, $2);
- printf ("if test $? -ne %s ; then\n", $1);
+ printf ("status=`echo '%s'| { ${GREP} -E -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 test \\#%d failed\n", ++n);
printf ("\tfailures=1\n");
printf ("fi\n");