[#35027] [Ruby 1.9-Bug#4352][Open] [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s) — "James M. Lawrence" <redmine@...>

Bug #4352: [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s)

16 messages 2011/02/01

[#35114] [Ruby 1.9-Bug#4373][Open] http.rb:677: [BUG] Segmentation fault — Christian Fazzini <redmine@...>

Bug #4373: http.rb:677: [BUG] Segmentation fault

59 messages 2011/02/06

[#35171] [Ruby 1.9-Bug#4386][Open] encoding: directive does not affect regex expressions — mathew murphy <redmine@...>

Bug #4386: encoding: directive does not affect regex expressions

9 messages 2011/02/09

[#35237] [Ruby 1.9-Bug#4400][Open] nested at_exit hooks run in strange order — Suraj Kurapati <redmine@...>

Bug #4400: nested at_exit hooks run in strange order

12 messages 2011/02/15

[ruby-core:35028] Re: [Ruby 1.9-Feature#4197][Closed] Improvement of the benchmark library

From: KOSAKI Motohiro <kosaki.motohiro@...>
Date: 2011-02-01 04:38:55 UTC
List: ruby-core #35028
Hi

> * lib/benchmark.rb: fix benchmarck to work with current ruby.
> atched by Benoit Daloze [ruby-core:33846] [ruby-dev:43143]
> erged from https://github.com/eregon/ruby/commits/benchmark
>
> * ib/benchmark (Report#width): update documentation
> * ib/benchmark: document the return value of #benchmark and the
> :list attribute in Report
> * ib/benchmark (Tms#format): rename variables, use String#%
> instead of Kernel.format
> * ib/benchmark: remove undocumented Benchmark::times (an alias
> of Process::times used twice)
> * ib/benchmark (#benchmark): use label_width for the caption
> * ib/benchmark (Tms#initialize): rename variables
> * ib/benchmark: allow title to not be a String and call #to_s
> * ib/benchmark (Benchmark#bm): return an Array of the times with
> the labels
> * ib/benchmark: correct output for Benchmark#bmbm
> (remove the extra space)
> * ib/benchmark: add a few tests for Benchmark::Tms output
> * ib/benchmark: improve style (enumerators, ljust, unused vars)
> * ib/benchmark: add spec about output and return value
> * ib/benchmark: improve basic style and consistency
> no parenthesis for print and use interpolation instead of printf
> * ib/benchmark: remove unnecessary conversions and variables
> * ib/benchmark: correct indentation
> * ib/benchmark: rename the FMTSTR constant and variable to FORMAT
> * ib/benchmark: remove useless exception
>
> * est/benchmark: remove unused variable warnings

The change log says, test/benchmark has been changed only warnings issue
by this commit. However it has more widely change and it made a false positive
test failure on windows.


  1) Failure:
test_0001__ruby_dev_40906_can_add_in_place_the_time_of_execution_of_the_block_gi
ven(Benchmark::Bugs) [C:/ruby/trunk/test/benchmark/test_benchmark.rb:127]:
Expected 0.0 to not be equal to 0.


Therefore, I commited following additional patch.
Thanks.

===================================================================
--- ChangeLog   (revision 30752)
+++ ChangeLog   (working copy)
@@ -1,3 +1,10 @@
+Tue Feb  1 13:20:39 2011  KOSAKI Motohiro  <kosaki.motohiro@gmail.com>
+
+       * test/benchmark/test_benchmark.rb (#capture_bench_output):
+         Added explict sleep. Windows have imprecise time support.
+         Thus Tms.new.Add!{} may be or may be not equal 0.
+         The test failure started since r30747.
+
 Tue Feb  1 11:03:47 2011  Ryan Davis  <ryan@lust.local>

        * lib/rubygems*: Import rubygems 1.5.0 (released version @ 1fb59d0)
Index: test/benchmark/test_benchmark.rb
===================================================================
--- test/benchmark/test_benchmark.rb    (revision 30752)
+++ test/benchmark/test_benchmark.rb    (working copy)
@@ -123,7 +123,7 @@
     it '[ruby-dev:40906] can add in-place the time of execution of the block gi
ven' do
       t = Benchmark::Tms.new
       t.real.must_equal 0
-      t.add! {}
+      t.add! { sleep 0.1 }
       t.real.wont_equal 0
     end
   end

In This Thread