grntest 1.6.8 → 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: f4c390d442cedfaff26e03d35e62f35c2958146f7bea7a8a2e6257004fc38338
4
- data.tar.gz: 24bbae078beddc9704797ee722e34480d1724fa0f9a494007f1967fb7e0199d3
3
+ metadata.gz: e19e5b6921dc29cf9645c976831b737b6bb94da8272e7a3cf7d85db0fa3a82f0
4
+ data.tar.gz: 5363b7f2169b9c15a4c3e3eaa26db86cde8ec741fd8b5471bbb108c193ed7191
5
5
  SHA512:
6
- metadata.gz: ef8e9f5d58cde904e3673cbe778849f2ff902bf21739d6a361e4121a775faeec1ce4bd1bb0a8f3420f64c6ebcbd379db10253aa99e9a0cdcee33950e5d896fd7
7
- data.tar.gz: 33bd84602a4c5715e8cffdbcf72ef1efb2320881fe206dba457f229a457864592b7dc8544efaeadb3bf42cd614786fbe158217cfbeedf53079618c2bffecd43a
6
+ metadata.gz: aa315b1549c5688029785250abf0cc5e5e9033dc9246249ffa086d4c3040c617c007fdd52ed6091a8f539d8013bd88487936fd14bb25246daa57fecbd7bd5ec9
7
+ data.tar.gz: 0cd8d9dcec896b8fa02f42316aaebe83e8078ea81bbfabfabded590bbc70bd8342960f372b201d59ad3a1864801c6b0f1aab7dff0f136804586ab995a1f46fcc
data/doc/text/news.md CHANGED
@@ -1,5 +1,18 @@
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
+
10
+ ## 1.6.9: 2024-02-05
11
+
12
+ ### Improvements
13
+
14
+ * reporter: benchmark-json: Added a test suite name to benchmark name.
15
+
3
16
  ## 1.6.8: 2024-02-05
4
17
 
5
18
  ### Fixes
@@ -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,10 +76,13 @@ 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|
82
+ name = "#{worker.suite_name}/#{result.test_name}"
83
83
  <<-JSON.chomp
84
84
  {
85
- "name": #{result.test_name.to_json},
85
+ "name": #{name.to_json},
86
86
  "run_name": #{benchmark.name.to_json},
87
87
  "run_type": "iteration",
88
88
  "iterations": #{benchmark.n_iterations},
@@ -93,7 +93,8 @@ module Grntest
93
93
  }
94
94
  JSON
95
95
  end
96
- puts(benchmarks.join(",\n"))
96
+ print(benchmarks.join(",\n"))
97
+ @first_benchmark = false
97
98
  end
98
99
 
99
100
  def on_suite_finish(worker)
@@ -103,6 +104,7 @@ module Grntest
103
104
  end
104
105
 
105
106
  def on_finish(result)
107
+ puts
106
108
  puts(<<-JSON)
107
109
  ]
108
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.8"
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.8
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou