From: Paul Eggert Date: Wed, 12 Jun 2013 03:23:28 +0000 (-0700) Subject: tests: zgrep-context assumes grep knows context X-Git-Tag: v1.7~56 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=a963e3a42d6da62ef6d017f28ded08534ad4c805;p=debian%2Fgzip tests: zgrep-context assumes grep knows context * tests/Makefile.am (TESTS_ENVIRONMENT): Pass GREP too. * tests/zgrep-context: Check that the underlying grep supports context options. Problem reported by Steven M. Schweda in . --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 53bfffa..37c7b8c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -79,6 +79,7 @@ TESTS_ENVIRONMENT = \ srcdir='$(srcdir)'; export srcdir; \ top_srcdir='$(top_srcdir)'; export top_srcdir; \ CC='$(CC)'; export CC; \ + GREP='$(GREP)'; export GREP; \ GZIP_TEST_NAME=`echo $$tst|sed 's,^\./,,;s,/,-,g'`; export GZIP_TEST_NAME; \ MAKE=$(MAKE); export MAKE; \ PACKAGE_BUGREPORT='$(PACKAGE_BUGREPORT)'; export PACKAGE_BUGREPORT; \ diff --git a/tests/zgrep-context b/tests/zgrep-context index f2e26d2..a3871eb 100755 --- a/tests/zgrep-context +++ b/tests/zgrep-context @@ -34,6 +34,12 @@ seq 40 > in || framework_failure_ gzip < in > in.gz || framework_failure_ seq 2 32 > exp || framework_failure_ +: ${GREP=grep} +$GREP -15 17 - < in > out && compare exp out || { + echo >&2 "$0: $GREP does not support context options; skipping this test" + exit 77 +} + fail=0 zgrep -15 17 - < in.gz > out || fail=1 compare exp out || fail=1