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 +4 -4
- data/doc/text/news.md +19 -0
- data/lib/grntest/executors/base-executor.rb +2 -0
- data/lib/grntest/reporters/base-reporter.rb +26 -5
- data/lib/grntest/reporters/stream-reporter.rb +39 -15
- data/lib/grntest/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa40165815d080049dd1910a6e417d10c669225e5b151882192181f830e24347
|
4
|
+
data.tar.gz: d4c4f85b34059a6d8f4c5ed66e4bc60e7294253dcfd8a0f1fc1dbecb42684912
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012-
|
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
|
-
|
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
|
-
|
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
|
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
|
-
#
|
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
|
-
|
44
|
-
|
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
|
-
|
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
|
-
|
53
|
-
|
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
|
-
|
58
|
-
|
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
|
-
|
63
|
-
|
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
|
-
|
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
|
-
|
72
|
-
|
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)
|
data/lib/grntest/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2023-09-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: diff-lcs
|