benchmark_driver 0.15.12 → 0.15.13

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: 4c069979523cfd025fba37653a117db89a52062bfedd7fe3d2c8b8ef5eaab329
4
- data.tar.gz: 23f32d6a140120ccbddd2ce704590cde72496fc0e7834674fecc865d04e8c943
3
+ metadata.gz: 2ae35c25d0a6bd2e2c5d5e04522c81fb99f020d4e53cd0ecb67964cdef95460c
4
+ data.tar.gz: 8af270bebabda4f1da320542a46f4ab4cee421a024996b9ddf6b46a2da7ff354
5
5
  SHA512:
6
- metadata.gz: d9d9a2cde658660d21dcf36a2ff872ac42c7a518aaf2a917744eacbcf8e2e95814ded6edb140a3b9d23273291850a2948cc47c09297d5b973b531da3a2582fd5
7
- data.tar.gz: 48a7c466c98a4304c3cc44bcfc7adf2d277c546e226cb3082999a1a384f038f969c7782b338b851bafd9c319d2d1aad4adca243b1c358346a2b79c1ca0ac0c78
6
+ metadata.gz: 2a0c0f81f4e0f5854eb10c139dfbe94e90993239121a318007567a7edcb6193cf5fe455dfe6b41223bd5244b754c56579604d3b67e0599385c897ff9d268fca1
7
+ data.tar.gz: f0b8927b886d57f43b6bdd48958e12f6c7870713b60a64f36ea5c04b3d89722c718c1057a59b3e2d0aa77a1609d8ad9cd193b241ec0ebb10f68a78bea3ea7209
@@ -1,3 +1,7 @@
1
+ # v0.15.13
2
+
3
+ - Show a command and stdout on `-vv` for `ips`, `time`, and `block` runner
4
+
1
5
  # v0.15.12
2
6
 
3
7
  - Show comparison on `--output=markdown` when `--output-compare` is also specified
@@ -107,8 +107,8 @@ class BenchmarkDriver::Runner::Ips
107
107
 
108
108
  duration = Tempfile.open(['benchmark_driver-', '.rb']) do |f|
109
109
  with_script(benchmark.render(result: f.path)) do |path|
110
- IO.popen([*context.executable.command, path], &:read) # TODO: print stdout if verbose=2
111
- if $?.success? && ((value = Float(f.read)) > 0)
110
+ success = execute(*context.executable.command, path, exception: false)
111
+ if success && ((value = Float(f.read)) > 0)
112
112
  value
113
113
  else
114
114
  BenchmarkDriver::Result::ERROR
@@ -137,10 +137,7 @@ class BenchmarkDriver::Runner::Ips
137
137
  end
138
138
 
139
139
  def with_script(script)
140
- if @config.verbose >= 2
141
- sep = '-' * 30
142
- $stdout.puts "\n\n#{sep}[Script begin]#{sep}\n#{script}#{sep}[Script end]#{sep}\n\n"
143
- end
140
+ debug_output('Script', script) if @config.verbose >= 2
144
141
 
145
142
  Tempfile.open(['benchmark_driver-', '.rb']) do |f|
146
143
  f.puts script
@@ -149,11 +146,20 @@ class BenchmarkDriver::Runner::Ips
149
146
  end
150
147
  end
151
148
 
152
- def execute(*args)
153
- IO.popen(args, &:read) # TODO: print stdout if verbose=2
154
- unless $?.success?
155
- raise "Failed to execute: #{args.shelljoin} (status: #{$?.exitstatus})"
149
+ def execute(*args, exception: true)
150
+ $stderr.puts "$ #{args.shelljoin}" if @config.verbose >= 2
151
+
152
+ stdout = IO.popen(args, &:read)
153
+ debug_output('Command output', stdout) if @config.verbose >= 2
154
+ if exception && !$?.success?
155
+ raise "Failed to execute: #{args.shelljoin} (status: #{$?})"
156
156
  end
157
+ $?.success?
158
+ end
159
+
160
+ def debug_output(name, text)
161
+ sep = '-' * 30
162
+ $stdout.puts "\n\n#{sep}[#{name} begin]#{sep}\n#{text}#{sep}[#{name} end]#{sep}\n\n"
157
163
  end
158
164
 
159
165
  WarmupScript = ::BenchmarkDriver::Struct.new(:preludes, :script, :teardown, :loop_count, :first_warmup_duration, :second_warmup_duration) do
@@ -1,3 +1,3 @@
1
1
  module BenchmarkDriver
2
- VERSION = '0.15.12'
2
+ VERSION = '0.15.13'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.12
4
+ version: 0.15.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-22 00:00:00.000000000 Z
11
+ date: 2020-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler