grntest 1.6.1 → 1.6.3

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: ca196b4236185746df0d683e0b9632c4fd1dbaeffa5ed63c4331f73784ccd010
4
- data.tar.gz: 3fe5db66385b146d1ea2fa1470141b8e0c884fc9481ac469d4111464e1d340d5
3
+ metadata.gz: aa40165815d080049dd1910a6e417d10c669225e5b151882192181f830e24347
4
+ data.tar.gz: d4c4f85b34059a6d8f4c5ed66e4bc60e7294253dcfd8a0f1fc1dbecb42684912
5
5
  SHA512:
6
- metadata.gz: 207e53bfebdb3366977a9f56546b8d7e83568ce4e459e09c877d377f3b874e219bf0c987db42fb113d0f03ea2501d91376cce1fa0566d157ca1bdbd42570724b
7
- data.tar.gz: e46deb249c95770f16782918482c391a475e926936a12670c98fb86e7b5941c7b7596fda39b427ae69541e56dd0b4eef0a178482b28a2f3148687282a58f951f
6
+ metadata.gz: 595dda68c29ddd69b0cdb5b76c96c3471c811e23d1a0f3a13622d5341ad463db65d0d71a21556675d22e56dc087b167fea64f61886abd9e62d0745a8cf157e13
7
+ data.tar.gz: bbdf5697336b6e0a7963e7d6b399624829fd3184bf5971c056292a9ac7f9197e28093c980c231772f323e2f072be9a3ceee87021a22d559ee59ffbe4eac3e80a
data/doc/text/news.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # News
2
2
 
3
+ ## 1.6.3: 2023-09-18
4
+
5
+ ### Improvements
6
+
7
+ * reporter: stream: Changed to show worker ID for each test.
8
+
9
+ * Added support for backtrace pattern provided by mruby 3.2.0.
10
+
11
+ ### Fixes
12
+
13
+ * reporter: stream: Fixed a bug that worker ID isn't outputted.
14
+
15
+ ## 1.6.2: 2023-08-24
16
+
17
+ ### Improvements
18
+
19
+ * reporter: stream: Changed to show "start" message in multi-workers
20
+ mode.
21
+
3
22
  ## 1.6.1: 2023-08-11
4
23
 
5
24
  ### Improvements
@@ -763,6 +763,8 @@ module Grntest
763
763
  true
764
764
  when /\A[a-zA-Z]:[\/\\]/
765
765
  true
766
+ when "(unknown):0"
767
+ true
766
768
  when /\A\(unknown\):\d+:\d+: /
767
769
  true
768
770
  when /\A[\w.\\-]+:\d+:\d+: /
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2019 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2023 Sutou Kouhei <kou@clear-code.com>
2
2
  #
3
3
  # This program is free software: you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
@@ -28,11 +28,19 @@ module Grntest
28
28
 
29
29
  private
30
30
  def synchronize
31
- @mutex.synchronize do
31
+ if single_worker?
32
32
  yield
33
+ else
34
+ @mutex.synchronize do
35
+ yield
36
+ end
33
37
  end
34
38
  end
35
39
 
40
+ def single_worker?
41
+ @tester.n_workers == 1
42
+ end
43
+
36
44
  def report_summary(result)
37
45
  puts(statistics_header)
38
46
  puts(colorize(statistics(result), result))
@@ -120,16 +128,25 @@ module Grntest
120
128
  reporter.report
121
129
  end
122
130
 
131
+ def report_worker_id(worker)
132
+ @worker_id_width ||= (Math.log10(@tester.n_workers) + 1).floor
133
+ print("[%*d] " % [@worker_id_width, worker.id])
134
+ end
135
+
136
+ def report_full_test_name(worker)
137
+ report_worker_id(worker) unless single_worker?
138
+ print("#{worker.suite_name}/#{worker.test_name}")
139
+ end
140
+
123
141
  def report_test(worker, result)
124
142
  report_marker(result)
125
- print("[#{worker.id}] ") if @tester.n_workers > 1
143
+ report_worker_id(worker) unless single_worker?
126
144
  puts(worker.suite_name)
127
145
  print(" #{worker.test_name}")
128
146
  report_test_result(result, worker.status)
129
147
  end
130
148
 
131
- def report_test_result(result, label)
132
- message = test_result_message(result, label)
149
+ def report_right_message(message)
133
150
  message_width = string_width(message)
134
151
  rest_width = @term_width - @current_column
135
152
  if rest_width > message_width
@@ -138,6 +155,10 @@ module Grntest
138
155
  puts(message)
139
156
  end
140
157
 
158
+ def report_test_result(result, label)
159
+ report_right_message(test_result_message(result, label))
160
+ end
161
+
141
162
  def test_result_message(result, label)
142
163
  elapsed_time = result.elapsed_time
143
164
  formatted_elapsed_time = "%.4fs" % elapsed_time
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2012-2013 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2023 Sutou Kouhei <kou@clear-code.com>
4
2
  #
5
3
  # This program is free software: you can redistribute it and/or modify
6
4
  # it under the terms of the GNU General Public License as published by
@@ -31,6 +29,7 @@ module Grntest
31
29
  end
32
30
 
33
31
  def on_suite_start(worker)
32
+ return unless single_worker?
34
33
  if worker.suite_name.bytesize <= @term_width
35
34
  puts(worker.suite_name)
36
35
  else
@@ -40,36 +39,61 @@ module Grntest
40
39
  end
41
40
 
42
41
  def on_test_start(worker)
43
- print(" #{worker.test_name}")
44
- @output.flush
42
+ synchronize do
43
+ if single_worker?
44
+ print(" #{worker.test_name}")
45
+ else
46
+ report_full_test_name(worker)
47
+ report_right_message("[start]")
48
+ end
49
+ @output.flush
50
+ end
45
51
  end
46
52
 
47
53
  def on_test_success(worker, result)
48
- report_test_result(result, worker.status)
54
+ synchronize do
55
+ report_full_test_name(worker) unless single_worker?
56
+ report_test_result(result, worker.status)
57
+ end
49
58
  end
50
59
 
51
60
  def on_test_failure(worker, result)
52
- report_test_result(result, worker.status)
53
- report_failure(result)
61
+ synchronize do
62
+ report_full_test_name(worker) unless single_worker?
63
+ report_test_result(result, worker.status)
64
+ report_failure(result)
65
+ end
54
66
  end
55
67
 
56
68
  def on_test_leak(worker, result)
57
- report_test_result(result, worker.status)
58
- report_actual(result) unless result.checked?
69
+ synchronize do
70
+ report_full_test_name(worker) unless single_worker?
71
+ report_test_result(result, worker.status)
72
+ report_actual(result) unless result.checked?
73
+ end
59
74
  end
60
75
 
61
76
  def on_test_omission(worker, result)
62
- report_test_result(result, worker.status)
63
- report_actual(result)
77
+ synchronize do
78
+ report_full_test_name(worker) unless single_worker?
79
+ report_test_result(result, worker.status)
80
+ report_actual(result)
81
+ end
64
82
  end
65
83
 
66
84
  def on_test_omission_suppressed(worker, result)
67
- report_test_result(result, worker.status)
85
+ synchronize do
86
+ report_full_test_name(worker) unless single_worker?
87
+ report_test_result(result, worker.status)
88
+ end
68
89
  end
69
90
 
70
91
  def on_test_no_check(worker, result)
71
- report_test_result(result, worker.status)
72
- report_actual(result)
92
+ synchronize do
93
+ report_full_test_name(worker) unless single_worker?
94
+ report_test_result(result, worker.status)
95
+ report_actual(result)
96
+ end
73
97
  end
74
98
 
75
99
  def on_test_finish(worker, result)
@@ -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.1"
17
+ VERSION = "1.6.3"
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.1
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-08-11 00:00:00.000000000 Z
12
+ date: 2023-09-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diff-lcs