Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Keep old 9-arg sample constructor and discard checksum #157

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ end
Sample(; evals=1, time, allocs=0, bytes=0, gc_fraction=0, compile_fraction=0, recompile_fraction=0, warmup=true) =
Sample(evals, time, allocs, bytes, gc_fraction, compile_fraction, recompile_fraction, warmup)

# For compatibility; older versions of Chairmarks accepted this form.
Sample(evals, time, allocs, bytes, gc_fraction, compile_fraction, recompile_fraction, warmup, checksum) =
Sample(evals, time, allocs, bytes, gc_fraction, compile_fraction, recompile_fraction, warmup)

"""
struct Benchmark
samples::Vector{Sample}
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ else
@testset "Issue #107, specialization" begin
@test (@b Int rand).allocs == 0
end

@testset "Issue #156, compat with old constructor" begin
@test Chairmarks.Sample(0,fill(NaN, 8)...) isa Chairmarks.Sample
end
end

@testset "Statistics Extension" begin
Expand Down
Loading