@@ -55,6 +55,11 @@ function _print_scaled_one_dec(io, value, scale, label="")
55
55
end
56
56
print (io, label)
57
57
end
58
+ function print_time (io:: IO , s:: PerfStats )
59
+ return print_time (
60
+ io; s. elapsedtime, s. bytes, s. gctime, s. allocs, s. compile_time, s. recompile_time
61
+ )
62
+ end
58
63
function print_time (io; elapsedtime, bytes= 0 , gctime= 0 , allocs= 0 , compile_time= 0 , recompile_time= 0 )
59
64
_print_scaled_one_dec (io, elapsedtime, 1e9 , " secs" )
60
65
if gctime > 0 || compile_time > 0
@@ -241,7 +246,7 @@ function _print_test_errors(report_iob, ts::DefaultTestSet, worker_info)
241
246
return nothing
242
247
end
243
248
244
- function print_state (io, state, ti, ntestitems; color= :default )
249
+ function print_state (io:: IO , state:: String , ti:: TestItem , ntestitems; color= :default )
245
250
interactive = parse (Bool, get (ENV , " RETESTITEMS_INTERACTIVE" , string (Base. isinteractive ())))
246
251
print (io, format (now (), " HH:MM:SS | " ))
247
252
! interactive && print (io, _mem_watermark ())
@@ -254,6 +259,13 @@ function print_state(io, state, ti, ntestitems; color=:default)
254
259
end
255
260
print (io, " test item $(repr (ti. name)) " )
256
261
end
262
+ function print_state (io:: IO , state:: String , ts:: TestSetup )
263
+ interactive = parse (Bool, get (ENV , " RETESTITEMS_INTERACTIVE" , string (Base. isinteractive ())))
264
+ print (io, format (now (), " HH:MM:SS | " ))
265
+ ! interactive && print (io, _mem_watermark ())
266
+ printstyled (io, rpad (uppercase (state), 5 ))
267
+ print (io, " test setup $(ts. name) " )
268
+ end
257
269
258
270
function print_file_info (io, ti)
259
271
print (io, " at " )
@@ -268,20 +280,33 @@ function log_testitem_skipped(ti::TestItem, ntestitems=0)
268
280
write (DEFAULT_STDOUT[], take! (io. io))
269
281
end
270
282
271
- # Marks the start of each test item
272
283
function log_testitem_start (ti:: TestItem , ntestitems= 0 )
273
284
io = IOContext (IOBuffer (), :color => get (DEFAULT_STDOUT[], :color , false ):: Bool )
274
285
print_state (io, " START" , ti, ntestitems)
275
286
print_file_info (io, ti)
276
287
println (io)
277
288
write (DEFAULT_STDOUT[], take! (io. io))
278
289
end
290
+ function log_testsetup_start (ts:: TestSetup )
291
+ io = IOContext (IOBuffer (), :color => get (DEFAULT_STDOUT[], :color , false ):: Bool )
292
+ print_state (io, " START" , ts)
293
+ print_file_info (io, ts)
294
+ println (io)
295
+ write (DEFAULT_STDOUT[], take! (io. io))
296
+ end
279
297
280
298
function log_testitem_done (ti:: TestItem , ntestitems= 0 )
281
299
io = IOContext (IOBuffer (), :color => get (DEFAULT_STDOUT[], :color , false ):: Bool )
282
300
print_state (io, " DONE" , ti, ntestitems)
283
- x = last (ti. stats) # always print stats for most recent run
284
- print_time (io; x. elapsedtime, x. bytes, x. gctime, x. allocs, x. compile_time, x. recompile_time)
301
+ stats = last (ti. stats) # always print stats for most recent run
302
+ print_time (io, stats)
303
+ println (io)
304
+ write (DEFAULT_STDOUT[], take! (io. io))
305
+ end
306
+ function log_testsetup_done (ts:: TestSetup , ntestitems= 0 )
307
+ io = IOContext (IOBuffer (), :color => get (DEFAULT_STDOUT[], :color , false ):: Bool )
308
+ print_state (io, " DONE" , ts)
309
+ print_time (io, ts. stats[])
285
310
println (io)
286
311
write (DEFAULT_STDOUT[], take! (io. io))
287
312
end
0 commit comments