grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v3.6-28-g5c628c7


From: Paul Eggert
Subject: grep branch, master, updated. v3.6-28-g5c628c7
Date: Mon, 9 Aug 2021 05:05:59 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  5c628c7074ae4a90a62165502afe5e7cb6a7eaa5 (commit)
      from  20b408ac0892b53ea55bc79acc0e98cd52840992 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=5c628c7074ae4a90a62165502afe5e7cb6a7eaa5


commit 5c628c7074ae4a90a62165502afe5e7cb6a7eaa5
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Mon Aug 9 02:05:29 2021 -0700

    tests: use awk, not seq
    
    Portability problem reported by Dagobert Michelsen in:
    https://lists.gnu.org/r/grep-devel/2021-08/msg00004.html
    * tests/hash-collision-perf, tests/long-pattern-perf:
    Don’t assume seq is installed; use awk instead.

diff --git a/tests/hash-collision-perf b/tests/hash-collision-perf
index 898b496..52266b6 100755
--- a/tests/hash-collision-perf
+++ b/tests/hash-collision-perf
@@ -28,7 +28,8 @@ fail=0
 # for digits, which never exhibited a problem with hash collisions.
 n_pat=40000
 while :; do
-  seq $n_pat > in || framework_failure_
+  script="BEGIN { for (i = 1; i <= $n_pat; i++) print i }"
+  ${AWK-awk} "$script" < /dev/null > in || framework_failure_
   small_ms=$(LC_ALL=C user_time_ 1 grep --file=in empty) || fail=1
   test $small_ms -ge 200 && break
   n_pat=$(expr $n_pat '*' 2)
@@ -36,7 +37,8 @@ done
 
 # Now, search for those same digits mapped to A-J.
 # With the PJW-based hash function, this became O(N^2).
-seq $n_pat | tr 0-9 A-J > in || framework_failure_
+script="BEGIN { for (i = 1; i <= $n_pat; i++) print i }"
+${AWK-awk} "$script" </dev/null | tr 0-9 A-J > in || framework_failure_
 large_ms=$(LC_ALL=C user_time_ 1 grep --file=in empty) || fail=1
 
 # Deliberately recording in an unused variable so it
diff --git a/tests/long-pattern-perf b/tests/long-pattern-perf
index 757bc94..a4cb089 100755
--- a/tests/long-pattern-perf
+++ b/tests/long-pattern-perf
@@ -26,10 +26,9 @@ fail=0
 expensive_
 
 echo x > in || framework_failure_
-# We could use seq -s '' (avoiding the tr filter), but I
-# suspect some version of seq does not honor that option.
 # Note that we want 10x the byte count (not line count) in the larger file.
-seq 10000 50000 | tr -d '\012' > r || framework_failure_
+script='BEGIN { for (i=10000; i<=50000; i++) printf "%d", i }'
+${AWK-awk} "$script" < /dev/null > r || framework_failure_
 cat r r r r r r r r r r > re-10x || framework_failure_
 mv r re || framework_failure_
 

-----------------------------------------------------------------------

Summary of changes:
 tests/hash-collision-perf | 6 ++++--
 tests/long-pattern-perf   | 5 ++---
 2 files changed, 6 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]