Skip to content

Commit

Permalink
tests: fixes for Julia v1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Nov 11, 2020
1 parent 1a0a785 commit aa60fb0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,21 @@ end
run(`$(Base.julia_cmd()) --startup-file=no --code-coverage=user -e $cmdstr`)
r = process_file(srcname, datadir)

target = Coverage.CovCount[nothing, 2, nothing, 0, nothing, 0, nothing, nothing, nothing, nothing, 0, nothing, nothing, nothing, nothing, nothing, 0, nothing, nothing, 0, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing]
if VERSION < v"1.5"
target = Coverage.CovCount[nothing, 2, nothing, 0, nothing, 0, nothing, nothing, nothing, nothing, 0, nothing, nothing, nothing, nothing, nothing, 0, nothing, nothing, 0, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing]
else
target = Coverage.CovCount[nothing, 1, nothing, 0, nothing, 0, nothing, nothing, nothing, nothing, 0, nothing, nothing, nothing, nothing, 0, 0, nothing, nothing, 0, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing]
end
target_disabled = map(x -> (x !== nothing && x > 0) ? x : nothing, target)
@test r.coverage == target

covtarget = (sum(x->x !== nothing && x > 0, target), sum(x->x !== nothing, target))
covtarget = (sum(x -> x !== nothing && x > 0, target), sum(!isnothing, target))
@test get_summary(r) == covtarget
@test get_summary(process_folder(datadir)) == (98, 106)
if VERSION < v"1.5"
@test get_summary(process_folder(datadir)) == (98, 106)
else
@test get_summary(process_folder(datadir)) == (98, 107)
end

r_disabled = withenv("DISABLE_AMEND_COVERAGE_FROM_SRC" => "yes") do
process_file(srcname, datadir)
Expand Down

0 comments on commit aa60fb0

Please sign in to comment.