completely unused functions don’t contribute to the ‘executable lines’ total
Same with comptime logic. At first, I thought it would be fairly simple to write a tool that updates kcov result to add unused functions, but thinking about it, we can't say, looking at the coverage result file if comptime code was used or not.
It's no longer 'find every function declaration that doesn't have coverage info and count the function as nuncovered'. We have to tell if each line of code is comptime or not and check if it was used. Basically, rewrite parts of the compiler.
There is no way we get accurate coverage reports without implementing a bit of the logic into the compiler itself.
EDIT: that said, thanks for the post, I use this in my projects, with great benefits since I read it months ago :).
For further actions, you may consider blocking this person and/or reporting abuse
Same with comptime logic. At first, I thought it would be fairly simple to write a tool that updates kcov result to add unused functions, but thinking about it, we can't say, looking at the coverage result file if comptime code was used or not.
It's no longer 'find every function declaration that doesn't have coverage info and count the function as nuncovered'. We have to tell if each line of code is comptime or not and check if it was used. Basically, rewrite parts of the compiler.
There is no way we get accurate coverage reports without implementing a bit of the logic into the compiler itself.
EDIT: that said, thanks for the post, I use this in my projects, with great benefits since I read it months ago :).