From 0ef2b4995ed2ef75888d3042c2f7bd7c0c32c8ec Mon Sep 17 00:00:00 2001 From: Zentrik Date: Fri, 29 Dec 2023 11:11:27 +0000 Subject: [PATCH] Fix tests that construct TrialContents Should be fine on 32 bit systems as we seem to always use Float64. --- src/execution.jl | 3 ++- test/TrialsTests.jl | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/execution.jl b/src/execution.jl index 043fbc4a..b12e626a 100644 --- a/src/execution.jl +++ b/src/execution.jl @@ -575,7 +575,8 @@ function generate_benchmark_definition( if $(params.experimental_enable_linux_perf) # Based on https://github.com/JuliaPerf/LinuxPerf.jl/blob/a7fee0ff261a5b5ce7a903af7b38d1b5c27dd931/src/LinuxPerf.jl#L1043-L1061 __linux_perf_groups = BenchmarkTools.LinuxPerf.set_default_spaces( - $(params.linux_perf_options.events), $(params.linux_perf_options.spaces) + $(params.linux_perf_options.events), + $(params.linux_perf_options.spaces), ) __linux_perf_bench = BenchmarkTools.LinuxPerf.make_bench_threaded( __linux_perf_groups; threads=$(params.linux_perf_options.threads) diff --git a/test/TrialsTests.jl b/test/TrialsTests.jl index 38a522ee..837a6a0b 100644 --- a/test/TrialsTests.jl +++ b/test/TrialsTests.jl @@ -8,14 +8,14 @@ using Test # Trial # ######### trial1 = BenchmarkTools.Trial(BenchmarkTools.Parameters(; evals=2)) -push!(trial1, TrialContents(2, 1, 4, 5, nothing, nothing, nothing)) -push!(trial1, TrialContents(21, 0, 41, 51, nothing, nothing, nothing)) +push!(trial1, TrialContents(2.0, 1.0, 4, 5, nothing, nothing, nothing)) +push!(trial1, TrialContents(21.0, 0.0, 41, 51, nothing, nothing, nothing)) trial2 = BenchmarkTools.Trial(BenchmarkTools.Parameters(; time_tolerance=0.15)) -push!(trial2, TrialContents(21, 0, 41, 51, nothing, nothing, nothing)) -push!(trial2, TrialContents(2, 1, 4, 5, nothing, nothing, nothing)) +push!(trial2, TrialContents(21.0, 0.0, 41, 51, nothing, nothing, nothing)) +push!(trial2, TrialContents(2.0, 1.0, 4, 5, nothing, nothing, nothing)) -push!(trial2, TrialContents(21, 0, 41, 51, nothing, nothing, nothing)) +push!(trial2, TrialContents(21.0, 0.0, 41, 51, nothing, nothing, nothing)) @test length(trial2) == 3 deleteat!(trial2, 3) @test length(trial1) == length(trial2) == 2 @@ -35,7 +35,7 @@ trial2.params = trial1.params @test trial1[2] == push!( BenchmarkTools.Trial(BenchmarkTools.Parameters(; evals=2)), - TrialContents(21, 0, 4, 5, nothing, nothing, nothing), + TrialContents(21.0, 0.0, 4, 5, nothing, nothing, nothing), ) @test trial1[1:end] == trial1 @@ -63,11 +63,11 @@ rmskew!(trial3) randtrial = BenchmarkTools.Trial(BenchmarkTools.Parameters()) for _ in 1:40 - push!(randtrial, TrialContents(rand(1:20), 1, 1, 1, nothing, nothing, nothing)) + push!(randtrial, TrialContents(rand(1.0:20.0), 1.0, 1, 1, nothing, nothing, nothing)) end while mean(randtrial) <= median(randtrial) - push!(randtrial, TrialContents(rand(10:20), 1, 1, 1, nothing, nothing, nothing)) + push!(randtrial, TrialContents(rand(10.0:20.0), 1.0, 1, 1, nothing, nothing, nothing)) end rmskew!(randtrial)