Skip to content

Commit cd83ac4

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a67e281 commit cd83ac4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/t7002-grep.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ test_description='git grep various.
88

99
. ./test-lib.sh
1010

11+
test_expect_success 'Check for external grep support' '
12+
case "$(git grep -h 2>&1|grep ext-grep)" in
13+
*"(default)"*)
14+
test_set_prereq EXTGREP
15+
true;;
16+
*"(ignored by this build)"*)
17+
true;;
18+
*)
19+
false;;
20+
esac
21+
'
22+
1123
cat >hello.c <<EOF
1224
#include <stdio.h>
1325
int main(int argc, const char **argv)

0 commit comments

Comments
 (0)