11module TrialsTests
22
33using BenchmarkTools
4+ using BenchmarkTools: TrialContents
45using Test
56
67# ########
@@ -46,7 +47,7 @@ trial2.params = trial1.params
4647
4748# outlier trimming
4849trial3 = BenchmarkTools. Trial (
49- BenchmarkTools. Parameters (), [1 , 2 , 3 , 10 , 11 ], [1 , 1 , 1 , 1 , 1 ], 1 , 1
50+ BenchmarkTools. Parameters (), [1 , 2 , 3 , 10 , 11 ], [1 , 1 , 1 , 1 , 1 ], 1 , 1 , nothing
5051)
5152
5253trimtrial3 = rmskew (trial3)
@@ -62,11 +63,11 @@ rmskew!(trial3)
6263randtrial = BenchmarkTools. Trial (BenchmarkTools. Parameters ())
6364
6465for _ in 1 : 40
65- push! (randtrial, TrialContents (rand (1 : 20 ), 1 , 1 , 1 ))
66+ push! (randtrial, TrialContents (rand (1 : 20 ), 1 , 1 , 1 , nothing , nothing , nothing ))
6667end
6768
6869while mean (randtrial) <= median (randtrial)
69- push! (randtrial, TrialContents (rand (10 : 20 ), 1 , 1 , 1 ))
70+ push! (randtrial, TrialContents (rand (10 : 20 ), 1 , 1 , 1 , nothing , nothing , nothing ))
7071end
7172
7273rmskew! (randtrial)
@@ -231,7 +232,7 @@ tj_r_2 = judge(tr; time_tolerance=2.0, memory_tolerance=2.0)
231232@test BenchmarkTools. prettymemory (1073741824 ) == " 1.00 GiB"
232233
233234@test sprint (show, " text/plain" , ta) == sprint (show, ta; context= :compact => false ) == """
234- BenchmarkTools.TrialEstimate:
235+ BenchmarkTools.TrialEstimate:
235236 time: 0.490 ns
236237 gctime: 0.000 ns (0.00%)
237238 memory: 2 bytes
@@ -246,7 +247,7 @@ BenchmarkTools.TrialEstimate:
246247
247248@test sprint (show, [ta, tb]) == " BenchmarkTools.TrialEstimate[0.490 ns, 1.000 ns]"
248249
249- trial1sample = BenchmarkTools. Trial (BenchmarkTools. Parameters (), [1 ], [1 ], 1 , 1 )
250+ trial1sample = BenchmarkTools. Trial (BenchmarkTools. Parameters (), [1 ], [1 ], 1 , 1 , nothing )
250251@test try
251252 display (trial1sample)
252253 true
@@ -267,14 +268,16 @@ else
267268 1.000 ns"""
268269end
269270
270- trial = BenchmarkTools. Trial (BenchmarkTools. Parameters (), [1.0 , 1.01 ], [0.0 , 0.0 ], 0 , 0 )
271+ trial = BenchmarkTools. Trial (
272+ BenchmarkTools. Parameters (), [1.0 , 1.01 ], [0.0 , 0.0 ], 0 , 0 , nothing
273+ )
271274@test sprint (show, " text/plain" , trial) == """
272275BenchmarkTools.Trial: 2 samples with 1 evaluation.
273276 Range (min … max): 1.000 ns … 1.010 ns ┊ GC (min … max): 0.00% … 0.00%
274277 Time (median): 1.005 ns ┊ GC (median): 0.00%
275278 Time (mean ± σ): 1.005 ns ± 0.007 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
276279
277- █ █
280+ █ █
278281 █▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█ ▁
279282 1 ns Histogram: frequency by time 1.01 ns <
280283
0 commit comments