grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.18-26-g6e3ea0d


From: Jim Meyering
Subject: grep branch, master, updated. v2.18-26-g6e3ea0d
Date: Mon, 10 Mar 2014 17:32:02 +0000

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  6e3ea0dd74426fd394225d3f9dc132e40cd92fd2 (commit)
      from  71e34feab53bb5713a34a1c73ca06859c0820d9d (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=6e3ea0dd74426fd394225d3f9dc132e40cd92fd2


commit 6e3ea0dd74426fd394225d3f9dc132e40cd92fd2
Author: Jim Meyering <address@hidden>
Date:   Sun Mar 9 21:25:51 2014 -0700

    tests: make a performance-measuring test less system-sensitive
    
    Andreas Schwab reported in http://debbugs.gnu.org/16941
    that this test would timeout and fail on m68k-suse-linux.
    Rather than testing absolute duration with a limit tuned
    to today's hardware, compare performance of grep with LC_ALL=C
    against that same command using LC_ALL=ja_JP.eucJP.
    * tests/init.cfg (require_hi_res_time_): New function.
    * tests/mb-non-UTF8-performance: Rewrite to use it:
    record absolute duration D of the first (normally much faster)
    command, and set a timeout of 8*D for the command running in
    an affected locale.

diff --git a/tests/init.cfg b/tests/init.cfg
index 5555e2d..3e9ab03 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -103,6 +103,21 @@ require_unibyte_locale()
   skip_ 'no unibyte locale found'
 }
 
+# Define hi_res_time_ to a function that prints the current time
+# as a floating point number with greater than 1-second resolution.
+# Otherwise, skip the requiring test.
+require_hi_res_time_()
+{
+  local cmd
+  for cmd in 'date +%s.%N' \
+          'perl -le "use Time::HiRes qw(time); print scalar time()"'; do
+      case $($cmd) in
+          *.[0-9]*) eval 'hi_res_time_() { '"$cmd"'; }'; break;;
+      esac
+  done
+  type hi_res_time_ || skip_ no high-resolution timer support
+}
+
 require_JP_EUC_locale_()
 {
   local locale=ja_JP.eucJP
diff --git a/tests/mb-non-UTF8-performance b/tests/mb-non-UTF8-performance
index 282f0c4..640d5db 100755
--- a/tests/mb-non-UTF8-performance
+++ b/tests/mb-non-UTF8-performance
@@ -18,15 +18,26 @@
 
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 require_timeout_
+require_hi_res_time_
 
 fail=0
 
-require_JP_EUC_locale_
-
 yes $(printf '%078d' 0) | head -50000 > in || framework_failure_
 
+start=$(hi_res_time_)
+LC_ALL=C grep -i foobar in; st=$?
+stop=$(hi_res_time_)
+
+# Use a multiple of the LC_ALL=C duration as the timeout for the JP/EUC test.
+# Typically, a multiple of 3 seems to be enough.
+timeout=$($AWK 'BEGIN { print 8 * ('$stop' - '$start')}' < /dev/null)
+
+test $st = 1 || fail=1
+
+require_JP_EUC_locale_
+
 # Expect no match, i.e., exit status of 1.  Anything else is an error.
-timeout 4 grep -i foobar in; st=$?
+timeout $timeout grep -i foobar in; st=$?
 test $st = 1 || fail=1
 
 Exit $fail

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

Summary of changes:
 tests/init.cfg                |   15 +++++++++++++++
 tests/mb-non-UTF8-performance |   17 ++++++++++++++---
 2 files changed, 29 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

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