Skip to content

Commit

Permalink
Keep old 9-arg Sample constructor and discard checksum (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
LilithHafner authored Dec 2, 2024
1 parent 9414b64 commit e7bb391
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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

0 comments on commit e7bb391

Please # to comment.