Skip to content

Kotlin: auto-generated methods for implementation with delegation are taken into account in coverage report #1002

@qwwdfsad

Description

@qwwdfsad

Steps to reproduce

  • JaCoCo version: 0.8.5.201910111838
  • Operating system: macOS Catalina 10.15
  • Tool integration: JaCoCo Gradle plugin
  • Complete executable reproducer: https://github.com/qwwdfsad/coverage-test, package coverage.delegates, run command ./gradlew test jacocoTestReport, report directory: build/jacocoHtml
  • Steps:
    Implement any interface with delegation. Example from the reproducer:
class DelegatedList : List<Int> by ArrayList() {
    override val size: Int
        get() = 42
}

and use it as

val list = DelegatedList()

Expected behaviour

Coverage reports only one missing method, size

Actual behaviour

All List methods are reported as not covered

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions