perf: add a comparison test of log --grep regex engines
[gitweb.git] / t / t7810-grep.sh
index daa906b9b0eebd3824141dedcc39c38b7498632f..561709ef6aa1b8394317b3a9e722f5bddc391498 100755 (executable)
@@ -775,6 +775,22 @@ test_expect_success 'grep -W with userdiff' '
        test_cmp expected actual
 '
 
+for threads in $(test_seq 0 10)
+do
+       test_expect_success "grep --threads=$threads & -c grep.threads=$threads" "
+               git grep --threads=$threads . >actual.$threads &&
+               if test $threads -ge 1
+               then
+                       test_cmp actual.\$(($threads - 1)) actual.$threads
+               fi &&
+               git -c grep.threads=$threads grep . >actual.$threads &&
+               if test $threads -ge 1
+               then
+                       test_cmp actual.\$(($threads - 1)) actual.$threads
+               fi
+       "
+done
+
 test_expect_success 'grep from a subdirectory to search wider area (1)' '
        mkdir -p s &&
        (