summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-01-04 19:34:14 +0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-01-06 18:28:11 -0800
commitcd83ac4156a211e019b47fa58de0784cee547ddf (patch)
tree6124e79b0001ee9a07f2876d19a840b2dada08ab
parentgrep: do not do external grep on skip-worktree entries (diff)
downloadtgif-cd83ac4156a211e019b47fa58de0784cee547ddf.tar.xz
t7002: set test prerequisite "external-grep" if supported
Add another test to set prerequisite EXTGREP if the current build supports external grep. This can be used to skip external grep only tests on builds that do not support this optimization. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t7002-grep.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh
index b4709e28b5..23eeb767f9 100755
--- a/t/t7002-grep.sh
+++ b/t/t7002-grep.sh
@@ -8,6 +8,18 @@ test_description='git grep various.
. ./test-lib.sh
+test_expect_success 'Check for external grep support' '
+ case "$(git grep -h 2>&1|grep ext-grep)" in
+ *"(default)"*)
+ test_set_prereq EXTGREP
+ true;;
+ *"(ignored by this build)"*)
+ true;;
+ *)
+ false;;
+ esac
+'
+
cat >hello.c <<EOF
#include <stdio.h>
int main(int argc, const char **argv)