diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2010-03-31 08:32:55 +0200 |
---|---|---|
committer | Paolo Bonzini <bonzini@gnu.org> | 2010-03-31 12:11:08 +0200 |
commit | 60569edcdc02afd7282e9bfa5b0f2a3f27e92227 (patch) | |
tree | b00d3526ffd5e09b54fa9ec2887e4eafb4060b72 | |
parent | 4571dcbdc0e71b3d1cbd75fa94bdf6c64a92036e (diff) | |
download | grep-60569edcdc02afd7282e9bfa5b0f2a3f27e92227.tar.gz |
tests: convert empty.sh to new style
* tests/empty.sh: Convert to init.sh, add 10-second timeout.
-rwxr-xr-x | tests/empty.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/empty.sh b/tests/empty.sh index b677aa3a..06dd4e0a 100755 --- a/tests/empty.sh +++ b/tests/empty.sh @@ -9,31 +9,34 @@ # notice and this notice are preserved. : ${srcdir=.} +. "$srcdir/init.sh"; path_prepend_ ../src + +require_timeout_ failures=0 for options in '-E' '-E -w' '-F -x' '-G -w -x'; do # should return 0 found a match - echo "" | ${GREP} $options -e '' > /dev/null 2>&1 + echo "" | timeout 10s grep $options -e '' if test $? -ne 0 ; then echo "Status: Wrong status code, test \#1 failed ($options)" failures=1 fi # should return 1 found no match - echo "abcd" | ${GREP} $options -f /dev/null > /dev/null 2>&1 + echo "abcd" | timeout 10s grep $options -f /dev/null if test $? -ne 1 ; then echo "Status: Wrong status code, test \#2 failed ($options)" failures=1 fi # should return 0 found a match - echo "abcd" | ${GREP} $options -f /dev/null -e "abcd" > /dev/null 2>&1 + echo "abcd" | timeout 10s grep $options -f /dev/null -e "abcd" if test $? -ne 0 ; then echo "Status: Wrong status code, test \#3 failed ($options)" failures=1 fi done -exit $failures +Exit $failures |