kotlinx-kover icon indicating copy to clipboard operation
kotlinx-kover copied to clipboard

Inline operation execution not detected

Open mgroth0 opened this issue 1 year ago • 2 comments

Describe the bug

I have discovered a case where an inline operation is not correctly detected by Kover.

Errors

This leads to errors in koverVerify if we exepct to have covered this code block.

Expected behavior

Inline operations should be detected just as non-inline operations are.

Reproducer

I will link a full reproducer project in a few minutes.

Environment

  • Kover Gradle Plugin version: 0.8.0-Beta
  • Gradle version: 8.6
  • Kotlin project type: Kotlin/JVM

mgroth0 avatar Mar 21 '24 03:03 mgroth0

Here is the reproducer: https://github.com/mgroth0/kover-573

To reproduce:

  1. ./gradlew test -i and observe that the output is
    hello test fun 1
    hello test fun 1 lambda
    hello test fun 2
    hello test fun 2 lambda
  1. ./gradlew koverVerify and observe it fails with Rule violated: lines covered percentage is 87.500000, but expected minimum is 100

  2. ./gradlew koverHtmlReport and observe in the HTML report that the line of code println("hello test fun 2 lambda") was not detected to have executed.

As the output from step 1 shows, however, the line definitely did execute.

mgroth0 avatar Mar 21 '24 03:03 mgroth0

Error reproduced when inline function, with a call to other inline functions inside, is used directly in the test

shanshin avatar Mar 21 '24 09:03 shanshin

Depends on https://youtrack.jetbrains.com/issue/KT-68006/Full-debug-information-for-call-of-InlineOnly

shanshin avatar May 15 '24 14:05 shanshin