I'm using kotlinx-kover for code coverage in a pro...
# code-coverage
l
I'm using kotlinx-kover for code coverage in a project. I am using interfaces to maximize code reuse. I'm seeing something strange in one of my projects. I have the following interfaces that add convenient members (LogicGate is another interface)
Copy code
interface SingleOutput: LogicGate {
    val output: Pin
        get() = outputs.first()
}
interface SingleInput: LogicGate {
    var input
        get() = inputs.first()
        set(value) { inputs[0] = value }
}
I generally implement Input first, then Output, but when I do that, kover shows that the line that says
interface SingleOutput: LogicGate
is not run. I had to switch the order of imports for one of my classes in order for the line to show as Green in kover's report. Is this expected, or a bug in kover?
Here is an example of how I normally implement the interfaces:
class AndGate: TwoInput, SingleOutput
. I changed one to
class Buffer: SingleOutput, SingleInput
, and kover showed the line as green. Changing it back to
class Buffer: SingleInput, SingleOutput
causes the SingleOutput declaration to be marked red in kover.
c
Please don't send answers to the channel, it spams everyone.
This is probably worth reporting with a reproduction example. I know a few examples where a structure line may count as uncovered, but nothing related to interfaces.
v
Output, but when I do that, kover shows that the line that says
interface SingleOutput: LogicGate
is not run
That’s likely to be a bug in an underlying coverage engine. Would be nice you you could report it with a reproducer to Kover GH
l
I can try to reproduce this and send a reproducer. From what I remember, it looked like the 'solution' of swapping order worked because it would only count coverage for the first interface.
v
That’s definitely something fishy; our coverage engine likely to misattribute something. It would be much appreciated!
l
This was over a year ago, so no promises this is still an issue. I haven't tried to undo the workaround yet and see if it still happens.
213 Views