No coverage report for Kotlin's built-in methods

The Kotlin functions marked with the inline are, firstly, built-in at compile time, and it seems that code coverage tools (like JaCoCo) do not allow you to correctly calculate code coverage. What is the usual approach to overcome this problem? Is there a way to make the test somehow avoid the nesting step and directly call the tested methods? Is it possible to skip the report generation of all built-in methods (for example, using the Gradle task) without excluding entire classes?

+7
testing code-coverage kotlin gradle jacoco
source share
2 answers

I do not believe that you can disable insertion, as some functions may not make any sense if they are not built-in. These include functions with reified types (because nesting makes type information accessible) and functions with lambdas as parameters, since they can affect the control flow of the method in which they are embedded.

+3
source share

There is a bug in the Java Coverage tools for JetBrains, see https://youtrack.jetbrains.com/issue/KT-12605 .

So, wait until the bug is fixed (or vote for it to speed up development)

0
source share

All Articles