t / perf / p7821-grep-engines-fixed.shon commit Merge branch 'ex/deprecate-empty-pathspec-as-match-all' into next (24db08a)
   1#!/bin/sh
   2
   3test_description="Comparison of git-grep's regex engines with -F
   4
   5Set GIT_PERF_7821_GREP_OPTS in the environment to pass options to
   6git-grep. Make sure to include a leading space,
   7e.g. GIT_PERF_7821_GREP_OPTS=' -w'. See p7820-grep-engines.sh for more
   8options to try.
   9"
  10
  11. ./perf-lib.sh
  12
  13test_perf_large_repo
  14test_checkout_worktree
  15
  16for pattern in 'int' 'uncommon' 'æ'
  17do
  18        for engine in fixed basic extended perl
  19        do
  20                if test $engine = "perl" && ! test_have_prereq PCRE
  21                then
  22                        prereq="PCRE"
  23                else
  24                        prereq=""
  25                fi
  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' || :
  28                "
  29        done
  30
  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
  37                fi
  38        '
  39done
  40
  41test_done