Skip to content

Commit 0ef2b49

Browse files
committed
Fix tests that construct TrialContents
Should be fine on 32 bit systems as we seem to always use Float64.
1 parent 07883ad commit 0ef2b49

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/execution.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,8 @@ function generate_benchmark_definition(
575575
if $(params.experimental_enable_linux_perf)
576576
# Based on https://github.com/JuliaPerf/LinuxPerf.jl/blob/a7fee0ff261a5b5ce7a903af7b38d1b5c27dd931/src/LinuxPerf.jl#L1043-L1061
577577
__linux_perf_groups = BenchmarkTools.LinuxPerf.set_default_spaces(
578-
$(params.linux_perf_options.events), $(params.linux_perf_options.spaces)
578+
$(params.linux_perf_options.events),
579+
$(params.linux_perf_options.spaces),
579580
)
580581
__linux_perf_bench = BenchmarkTools.LinuxPerf.make_bench_threaded(
581582
__linux_perf_groups; threads=$(params.linux_perf_options.threads)

test/TrialsTests.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ using Test
88
# Trial #
99
#########
1010
trial1 = BenchmarkTools.Trial(BenchmarkTools.Parameters(; evals=2))
11-
push!(trial1, TrialContents(2, 1, 4, 5, nothing, nothing, nothing))
12-
push!(trial1, TrialContents(21, 0, 41, 51, nothing, nothing, nothing))
11+
push!(trial1, TrialContents(2.0, 1.0, 4, 5, nothing, nothing, nothing))
12+
push!(trial1, TrialContents(21.0, 0.0, 41, 51, nothing, nothing, nothing))
1313

1414
trial2 = BenchmarkTools.Trial(BenchmarkTools.Parameters(; time_tolerance=0.15))
15-
push!(trial2, TrialContents(21, 0, 41, 51, nothing, nothing, nothing))
16-
push!(trial2, TrialContents(2, 1, 4, 5, nothing, nothing, nothing))
15+
push!(trial2, TrialContents(21.0, 0.0, 41, 51, nothing, nothing, nothing))
16+
push!(trial2, TrialContents(2.0, 1.0, 4, 5, nothing, nothing, nothing))
1717

18-
push!(trial2, TrialContents(21, 0, 41, 51, nothing, nothing, nothing))
18+
push!(trial2, TrialContents(21.0, 0.0, 41, 51, nothing, nothing, nothing))
1919
@test length(trial2) == 3
2020
deleteat!(trial2, 3)
2121
@test length(trial1) == length(trial2) == 2
@@ -35,7 +35,7 @@ trial2.params = trial1.params
3535

3636
@test trial1[2] == push!(
3737
BenchmarkTools.Trial(BenchmarkTools.Parameters(; evals=2)),
38-
TrialContents(21, 0, 4, 5, nothing, nothing, nothing),
38+
TrialContents(21.0, 0.0, 4, 5, nothing, nothing, nothing),
3939
)
4040
@test trial1[1:end] == trial1
4141

@@ -63,11 +63,11 @@ rmskew!(trial3)
6363
randtrial = BenchmarkTools.Trial(BenchmarkTools.Parameters())
6464

6565
for _ in 1:40
66-
push!(randtrial, TrialContents(rand(1:20), 1, 1, 1, nothing, nothing, nothing))
66+
push!(randtrial, TrialContents(rand(1.0:20.0), 1.0, 1, 1, nothing, nothing, nothing))
6767
end
6868

6969
while mean(randtrial) <= median(randtrial)
70-
push!(randtrial, TrialContents(rand(10:20), 1, 1, 1, nothing, nothing, nothing))
70+
push!(randtrial, TrialContents(rand(10.0:20.0), 1.0, 1, 1, nothing, nothing, nothing))
7171
end
7272

7373
rmskew!(randtrial)

0 commit comments

Comments
 (0)