aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-01-04 19:34:14 +0700
committerJunio C Hamano <gitster@pobox.com>2010-01-06 18:28:11 -0800
commitcd83ac4156a211e019b47fa58de0784cee547ddf (patch)
tree6124e79b0001ee9a07f2876d19a840b2dada08ab /t
parenta67e28116287ea84b162b22a5b69ec02ebd34023 (diff)
downloadgit-cd83ac4156a211e019b47fa58de0784cee547ddf.tar.gz
git-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>
Diffstat (limited to 't')
-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 b4709e28b..23eeb767f 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)