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
10 If GIT_PERF_7821_THREADS is set to a list of threads (e.g. '1 4 8'
11 etc.) we will test the patterns under those numbers of threads.
17 test_checkout_worktree
19 if test -n "$GIT_PERF_GREP_THREADS"
21 test_set_prereq PERF_GREP_ENGINES_THREADS
24 for pattern in 'int' 'uncommon' 'æ'
26 for engine in fixed basic extended perl
28 if test $engine = "perl" && ! test_have_prereq PCRE
34 if ! test_have_prereq PERF_GREP_ENGINES_THREADS
36 test_perf $prereq "$engine grep$GIT_PERF_7821_GREP_OPTS $pattern" "
37 git -c grep.patternType=$engine grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine' || :
40 for threads in $GIT_PERF_GREP_THREADS
42 test_perf PTHREADS,$prereq "$engine grep$GIT_PERF_7821_GREP_OPTS $pattern with $threads threads" "
43 git -c grep.patternType=$engine -c grep.threads=$threads grep$GIT_PERF_7821_GREP_OPTS $pattern >'out.$engine.$threads' || :
49 if ! test_have_prereq PERF_GREP_ENGINES_THREADS
51 test_expect_success "assert that all engines found the same for$GIT_PERF_7821_GREP_OPTS $pattern" '
52 test_cmp out.fixed out.basic &&
53 test_cmp out.fixed out.extended &&
54 if test_have_prereq PCRE
56 test_cmp out.fixed out.perl
60 for threads in $GIT_PERF_GREP_THREADS
62 test_expect_success PTHREADS "assert that all engines found the same for$GIT_PERF_7821_GREP_OPTS $pattern under threading" "
63 test_cmp out.fixed.$threads out.basic.$threads &&
64 test_cmp out.fixed.$threads out.extended.$threads &&
65 if test_have_prereq PCRE
67 test_cmp out.fixed.$threads out.perl.$threads