Ævar Arnfjörð Bjarmason | 723fc5a | 2017-05-25 19:45:24 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description="Comparison of git-log's --grep regex engines with -F |
| 4 | |
| 5 | Set GIT_PERF_4221_LOG_OPTS in the environment to pass options to |
| 6 | git-grep. Make sure to include a leading space, |
| 7 | e.g. GIT_PERF_4221_LOG_OPTS=' -i'. Some options to try: |
| 8 | |
| 9 | -i |
| 10 | --invert-grep |
| 11 | -i --invert-grep |
| 12 | " |
| 13 | |
| 14 | . ./perf-lib.sh |
| 15 | |
| 16 | test_perf_large_repo |
| 17 | test_checkout_worktree |
| 18 | |
| 19 | for pattern in 'int' 'uncommon' 'æ' |
| 20 | do |
| 21 | for engine in fixed basic extended perl |
| 22 | do |
| 23 | if test $engine = "perl" && ! test_have_prereq PCRE |
| 24 | then |
| 25 | prereq="PCRE" |
| 26 | else |
| 27 | prereq="" |
| 28 | fi |
Neeraj Singh | 5dccd91 | 2022-04-04 22:20:17 -0700 | [diff] [blame] | 29 | test_perf "$engine log$GIT_PERF_4221_LOG_OPTS --grep='$pattern'" \ |
| 30 | --prereq "$prereq" " |
Ævar Arnfjörð Bjarmason | 723fc5a | 2017-05-25 19:45:24 +0000 | [diff] [blame] | 31 | git -c grep.patternType=$engine log --pretty=format:%h$GIT_PERF_4221_LOG_OPTS --grep='$pattern' >'out.$engine' || : |
| 32 | " |
| 33 | done |
| 34 | |
| 35 | test_expect_success "assert that all engines found the same for$GIT_PERF_4221_LOG_OPTS '$pattern'" ' |
| 36 | test_cmp out.fixed out.basic && |
| 37 | test_cmp out.fixed out.extended && |
| 38 | if test_have_prereq PCRE |
| 39 | then |
| 40 | test_cmp out.fixed out.perl |
| 41 | fi |
| 42 | ' |
| 43 | done |
| 44 | |
| 45 | test_done |