-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
kind:bugA bug in the code. Does not apply to documentation, specs, etc.A bug in the code. Does not apply to documentation, specs, etc.topic:compiler:debugger
Description
Bug Report
https://github.com/SimonKagstrom/kcov uses DWARF debug information to power its code coverage reporting. While viewing the reports more closely I notice that it reports certain things as missed even tho they were most definitely hits. For example with the following code:
# test.cr
class Foo
getter callback : Proc(Int32, Int32)? = nil
def callback(&@callback : Int32 -> Int32) : Nil
end
end
foo = Foo.new
foo.callback do |val|
val * 10
end
pp foo.callback.not_nil!.call 10Generate the report:
$ crystal build --debug test.cr
$ kcov --include-path=./test.cr ./coverage ./test
100
$ xdg-open coverage/index.htmlResults in:
The block body and the calling of the proc are reported as missed, even tho you can clearly see 100 in the console output. Using getter! instead of an explicit not_nil! makes it correctly report that line as a hit.
I think this implies those specific lines are missing debug information?
nobodywasishere
Metadata
Metadata
Assignees
Labels
kind:bugA bug in the code. Does not apply to documentation, specs, etc.A bug in the code. Does not apply to documentation, specs, etc.topic:compiler:debugger
