diff --git a/src/CoverageTools.jl b/src/CoverageTools.jl index e085345..5172bde 100644 --- a/src/CoverageTools.jl +++ b/src/CoverageTools.jl @@ -215,7 +215,6 @@ module CoverageTools # also check for line markers if excluded || occursin("COV_EXCL_LINE", line) - @debug "removing line $l: $line" coverage[l] = nothing end end diff --git a/test/runtests.jl b/test/runtests.jl index 9a64cf4..c7e5e8f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -117,7 +117,11 @@ end run(`$(Base.julia_cmd()) --startup-file=no --code-coverage=user -e $cmdstr`) r = process_file(srcname, datadir) - target = CoverageTools.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] + target = if VERSION >= v"1.5.0-DEV.42" + CoverageTools.CovCount[nothing, 1, 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] + else + CoverageTools.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] + end target_disabled = map(x -> (x !== nothing && x > 0) ? x : nothing, target) @test r.coverage == target @@ -161,9 +165,20 @@ end r = withenv("DISABLE_AMEND_COVERAGE_FROM_SRC" => "yes") do process_file(srcname, "test") end - @test r.coverage == [nothing, 2, 1, 1, nothing, 1, nothing, 1, nothing, nothing] - amend_coverage_from_src!(r.coverage, r.filename) - @test r.coverage == [nothing, 2, nothing, 1, nothing, nothing, nothing, 1, nothing, nothing] + # FIXME: coverage information for this function is useless with Julia 1.0 + if VERSION >= v"1.1" + @test r.coverage == if VERSION >= v"1.5.0-DEV.42" + [nothing, 1, 1, 1, nothing, 1, nothing, 1, nothing] + else + [nothing, 2, 1, 1, nothing, 1, nothing, 1, nothing, nothing] + end + amend_coverage_from_src!(r.coverage, r.filename) + @test r.coverage == if VERSION >= v"1.5.0-DEV.42" + [nothing, 1, nothing, 1, nothing, nothing, nothing, 1, nothing] + else + [nothing, 2, nothing, 1, nothing, nothing, nothing, 1, nothing, nothing] + end + end end end