@@ -162,6 +162,7 @@ def test_ALL
162
162
end
163
163
164
164
puts 'Finished in ' . green + '%0.2fs' . white % time_for_lang + '.' . green
165
+ puts
165
166
166
167
unless @hints . empty?
167
168
flunk @hints . map { |hint | ' ' + hint } . join ( "\n " ) + "\n "
@@ -178,7 +179,11 @@ def examples_test scanner, max
178
179
puts "No examples found!" . red
179
180
else
180
181
puts '%d' . yellow % examples . size + " example#{ 's' if examples . size > 1 } found." . green
182
+ puts
181
183
end
184
+
185
+ total_filesize = total_time_for_scanning = total_time_for_direct_streaming = 0
186
+
182
187
for example_filename in examples . sort
183
188
@known_issue_description = @known_issue_ticket_url = nil
184
189
name = File . basename ( example_filename , ".#{ extension } " )
@@ -204,18 +209,28 @@ def examples_test scanner, max
204
209
205
210
if defined? ( @time_for_encoding ) && @time_for_encoding
206
211
time_total = @time_for_scanning + @time_for_encoding
207
- print '%5.2fs' . blue % time_total
208
- print ':' . yellow + '%5.2fs' . magenta % @time_for_direct_streaming
212
+ # print '%5.2fs'.blue % time_total
213
+ # print ':'.yellow + '%5.2fs'.magenta % @time_for_direct_streaming
209
214
if filesize >
10000
;= 1024
210
- print ' '
211
- print '%4.0f scan' . white % [ tokens . count / @time_for_scanning / 1000 ] + ', ' . green
212
- print '%4.0f encode' . white % [ tokens . count / @time_for_encoding / 1000 ] + ', ' . green
213
- print '%4.0f sep' . blue % [ tokens . count / time_total / 1000 ] + ', ' . green
215
+ print 'in kTok/s: ' . white
216
+ print '%4.0f scan' . yellow % [ tokens . count / @time_for_scanning / 1000 ]
217
+ print ' + ' . white
218
+ print '%4.0f encode' . white % [ tokens . count / @time_for_encoding / 1000 ]
219
+ print ' = ' . white
220
+ print '%4.0f both' . blue % [ tokens . count / time_total / 1000 ] + ', '
214
221
print '%4.0f stream' . magenta % [ tokens . count / @time_for_direct_streaming / 1000 ]
215
- print ' (KTok/s)' . white
216
- if filesize > 5000
217
- print ' = %4.0f kB/s' . yellow % [ filesize / @time_for_direct_streaming / 1000 ]
218
- end
222
+ print ', ' . green
223
+
224
+ print 'in kB/s: ' . white
225
+ print '%5.0f' . yellow % [ filesize / @time_for_scanning / 1000 ]
226
+ print ' / ' . white
227
+ print '%5.0f' . magenta % [ filesize / @time_for_direct_streaming / 1000 ]
228
+
229
+ total_filesize += filesize
230
+ total_time_for_scanning += @time_for_scanning
231
+ total_time_for_direct_streaming += @time_for_direct_streaming
232
+ else
233
+ print 'too small' . white
219
234
end
220
235
@time_for_encoding = @time_for_scanning = nil
221
236
end
@@ -233,6 +248,17 @@ def examples_test scanner, max
233
248
end
234
249
end
235
250
end
251
+
252
+ puts
253
+
254
+ if total_time_for_scanning > 0 && total_time_for_direct_streaming > 0
255
+ print "Average speed for #{ scanner . class . title } scanner: " . green
256
+ print '%0.0f' . yellow % [ total_filesize / total_time_for_scanning / 1000 ]
257
+ print ' kB/s scanning / ' . white
258
+ print '%0.0f' . magenta % [ total_filesize / total_time_for_direct_streaming / 1000 ]
259
+ print ' kB/s highlighting.' . white
260
+ puts
261
+ end
236
262
end
237
263
end
238
264
@@ -514,7 +540,7 @@ def load_suite name
514
540
suite = File . join ( $mydir, name , 'suite.rb' )
515
541
require suite
516
542
rescue LoadError
517
- $stderr . puts <<-ERR
543
+ puts <<-ERR
518
544
519
545
!! Suite #{ suite } not found
520
546
0 commit comments