grntest 1.6.9 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 874f9b46d80e926dac44a36947f89cb2f8fee99a1e00ae1063b5e3d79b07d706
4
- data.tar.gz: 44643f5dc0b404cbfde294a218f19a0251afef70c01ae6d8a9ab3130556af3e3
3
+ metadata.gz: e19e5b6921dc29cf9645c976831b737b6bb94da8272e7a3cf7d85db0fa3a82f0
4
+ data.tar.gz: 5363b7f2169b9c15a4c3e3eaa26db86cde8ec741fd8b5471bbb108c193ed7191
5
5
  SHA512:
6
- metadata.gz: 13b411cbd6573214a097ca372a9e0a810b81c485dd4a241030996f3030561082a82939f278417ec2eb213e64505a9dab4c693130403ee30c557cc73b58f9915e
7
- data.tar.gz: 7ae1e11e823be0eda76acc7e0af1f11d168e2859287c4cfb435ffd69b0dd034a6065befab670997972eca56dbb1d769e8756705edc505bb51a3cf42f6e8a8abd
6
+ metadata.gz: aa315b1549c5688029785250abf0cc5e5e9033dc9246249ffa086d4c3040c617c007fdd52ed6091a8f539d8013bd88487936fd14bb25246daa57fecbd7bd5ec9
7
+ data.tar.gz: 0cd8d9dcec896b8fa02f42316aaebe83e8078ea81bbfabfabded590bbc70bd8342960f372b201d59ad3a1864801c6b0f1aab7dff0f136804586ab995a1f46fcc
data/doc/text/news.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # News
2
2
 
3
+ ## 1.7.0: 2024-02-05
4
+
5
+ ### Fixes
6
+
7
+ * reporter: benchmark-json: Fixed a bug that invalid JSON may be
8
+ generated.
9
+
3
10
  ## 1.6.9: 2024-02-05
4
11
 
5
12
  ### Improvements
@@ -21,10 +21,6 @@ require "grntest/reporters/base-reporter"
21
21
  module Grntest
22
22
  module Reporters
23
23
  class BenchmarkJSONReporter < BaseReporter
24
- def initialize(tester)
25
- super
26
- end
27
-
28
24
  def on_start(result)
29
25
  puts(<<-JSON)
30
26
  {
@@ -40,11 +36,12 @@ module Grntest
40
36
  "mhz_per_cpu": #{cpu_cycles_per_second / 1_000_000.0},
41
37
  JSON
42
38
  end
43
- puts(<<-JSON)
39
+ print(<<-JSON.chomp)
44
40
  "caches": []
45
41
  },
46
42
  "benchmarks": [
47
43
  JSON
44
+ @first_benchmark = true
48
45
  end
49
46
 
50
47
  def on_worker_start(worker)
@@ -79,6 +76,8 @@ module Grntest
79
76
 
80
77
  def on_test_finish(worker, result)
81
78
  return if result.benchmarks.empty?
79
+ print(",") unless @first_benchmark
80
+ puts
82
81
  benchmarks = result.benchmarks.collect do |benchmark|
83
82
  name = "#{worker.suite_name}/#{result.test_name}"
84
83
  <<-JSON.chomp
@@ -94,7 +93,8 @@ module Grntest
94
93
  }
95
94
  JSON
96
95
  end
97
- puts(benchmarks.join(",\n"))
96
+ print(benchmarks.join(",\n"))
97
+ @first_benchmark = false
98
98
  end
99
99
 
100
100
  def on_suite_finish(worker)
@@ -104,6 +104,7 @@ module Grntest
104
104
  end
105
105
 
106
106
  def on_finish(result)
107
+ puts
107
108
  puts(<<-JSON)
108
109
  ]
109
110
  }
@@ -14,5 +14,5 @@
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  module Grntest
17
- VERSION = "1.6.9"
17
+ VERSION = "1.7.0"
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grntest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.9
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou