benchmark_driver 0.15.8 → 0.15.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e04ca43a3337139b2b4608642785f79e058062c9559a77bb488c4b6171d6f6a5
4
- data.tar.gz: 9f3d95083d39c13dcb7586a949df6d6ac95253f5ae0f36c1e611e1ed45316a6c
3
+ metadata.gz: e99ed161f437a1c8e08847db6bee7f8ada9773fc527d1be4aaa6436c18ce16d3
4
+ data.tar.gz: cc6aa7374390d0451f8d75451676481b032d1d7d8fe4bbdc442e77b4c2fad19a
5
5
  SHA512:
6
- metadata.gz: 513c1e5dbe4703708fb13cf970b1c96c14ff008ebfc5f13381388d5d857f1b76089cfd1b8347ef8a50461af5aa9aeed79180f1dcd68341586cb77081bed01cd1
7
- data.tar.gz: a90e8729e8724ad50fb42731d5e3fa53acb5a722e3eb2ae26f18a435f9cb02af6eb0a6a69a2676cb02cceab9d7cc563b751e477819497f99fcedf42a918362a6
6
+ metadata.gz: 2a89c19b24c61a01b97a6814c6a47185fb19ce81ea8afedbfefa812610aa4774179a128d8e365435c58f967d84faf61ce7628b8672db65e7962a5ee950045db6
7
+ data.tar.gz: 71417fee7eadda1c26f6d0cab1c9c7563eb1d8da011f4b4b2c2e1701eaba573bdbf67230fb74034cc08353396bc20e6573ea79cc8acb8ab17f7c6cd01285cb21
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # v0.15.9
2
+
3
+ - Prefer an exact match in RVM version selection
4
+ - Fix a negative duration crash in `ips`, `time` and `once` runners
5
+ - Fix bugs in old TruffleRuby not supporting `keyword_init` of Struct
6
+
1
7
  # v0.15.8
2
8
 
3
9
  - Add `--rvm` option and `.rvm` Ruby interface to use RVM
@@ -108,8 +108,8 @@ class BenchmarkDriver::Runner::Ips
108
108
  duration = Tempfile.open(['benchmark_driver-', '.rb']) do |f|
109
109
  with_script(benchmark.render(result: f.path)) do |path|
110
110
  IO.popen([*context.executable.command, path], &:read) # TODO: print stdout if verbose=2
111
- if $?.success?
112
- Float(f.read)
111
+ if $?.success? && ((value = Float(f.read)) > 0)
112
+ value
113
113
  else
114
114
  BenchmarkDriver::Result::ERROR
115
115
  end
@@ -66,8 +66,8 @@ class BenchmarkDriver::Runner::Once
66
66
  Tempfile.open(['benchmark_driver-', '.rb']) do |f|
67
67
  with_script(benchmark.render(result: f.path)) do |path|
68
68
  IO.popen([*context.executable.command, path], &:read) # TODO: print stdout if verbose=2
69
- if $?.success?
70
- Float(f.read)
69
+ if $?.success? && ((value = Float(f.read)) > 0)
70
+ value
71
71
  else
72
72
  BenchmarkDriver::Result::ERROR
73
73
  end
@@ -23,7 +23,8 @@ module BenchmarkDriver
23
23
  else
24
24
  rubies = Pathname.new("#{ENV['rvm_path']}/rubies")
25
25
  abort "Rubies path '#{rubies}' not found" unless rubies.exist?
26
- ruby_root = rubies.children.detect { |path| path.directory? && path.basename.to_s.match(version) }
26
+ ruby_list = rubies.children.select { |path| path.directory? && path.basename.to_s.match(version) }
27
+ ruby_root = ruby_list.detect { |path| path.basename.to_s == version } || ruby_list[0]
27
28
  abort "Version '#{version}' not found" unless ruby_root
28
29
  "#{ruby_root}/bin/ruby"
29
30
  end
@@ -5,8 +5,8 @@
5
5
  module BenchmarkDriver
6
6
  class ::Struct
7
7
  SUPPORT_KEYWORD_P = begin
8
- ::Struct.new(:a, keyword_init: true)
9
- true
8
+ s = ::Struct.new(:a, keyword_init: true)
9
+ s.new(a: 1).a == 1
10
10
  rescue TypeError
11
11
  false
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module BenchmarkDriver
2
- VERSION = '0.15.8'
2
+ VERSION = '0.15.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.8
4
+ version: 0.15.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun