Skip to content

Some lines are executed but not shown as covered. #475

Open

Description

@adrianboyko

In the image below, lines 181, 184, and 187 are showing as not covered by my tests but the tests specifically test the correct execution of those lines. To verify that there wasn't a problem in my tests, I set breakpoints on those lines and noted that they are hit when I run the tests under debug. As a final check, I added the print statement on line 180 so I would have a visual verification that line 180 is being executed during testing from the command line.

coverage_result

Here's the output I see at the command line:

coverage_run

Note that the stack trace reports that line 180 did, in fact run.

Here's what it says in lcov.info for that run:

DA:175,1
DA:176,2
DA:177,2
DA:178,2
DA:179,2
DA:180,0   <-- We see the output of line 180 in the image above but it is zero here.
DA:181,0
DA:183,2
DA:184,0
DA:186,2
DA:187,0

The same thing happens at another point in my code:

other_bad_coverage

It's interesting that the coverage problem only happens in the immediate vicinity of a call to wipRec._addIssue(...). Coverage indicates that _addIssue is running even though it is only called from the lines above, which coverage says are not running.

Any idea what might be going on here? Looks like a bug to me.

Activity

  1. JeanPSF commented on Aug 16, 2022

    @JeanPSF

    Is it the same problem I am running into?
    #506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions