Add structure representing hash algorithm
[git.git] / t / perf / p7821-grep-engines-fixed.sh
blobc7ef1e198fb9b803bcc5ed08fa553736ce5442d0
1 #!/bin/sh
3 test_description="Comparison of git-grep's regex engines with -F
5 Set GIT_PERF_7821_GREP_OPTS in the environment to pass options to
6 git-grep. Make sure to include a leading space,
7 e.g. GIT_PERF_7821_GREP_OPTS=' -w'. See p7820-grep-engines.sh for more
8 options to try.
11 . ./perf-lib.sh
13 test_perf_large_repo
14 test_checkout_worktree
16 for pattern in 'int' 'uncommon' 'æ'
18 for engine in fixed basic extended perl
20 if test $engine = "perl" && ! test_have_prereq PCRE
21 then
22 prereq="PCRE"
23 else
24 prereq=""
26 test_perf $prereq "$engine grep$GIT_PERF_7821_GREP_OPTS $pattern" "
27 git -c grep.patternType=$engine grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine' || :
29 done
31 test_expect_success "assert that all engines found the same for$GIT_PERF_7821_GREP_OPTS $pattern" '
32 test_cmp out.fixed out.basic &&
33 test_cmp out.fixed out.extended &&
34 if test_have_prereq PCRE
35 then
36 test_cmp out.fixed out.perl
39 done
41 test_done