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