Skip to content

Commit

Permalink
t7002: set test prerequisite "external-grep" if supported
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Jan 7, 2010
1 parent a67e281 commit cd83ac4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions t/t7002-grep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cd83ac4

Please sign in to comment.