Skip to content

"Jump to the function exit" in lcov report with multiline conditional #1875

Closed

Description

@zackw

This test module contains a very simple multi-line controlling expression for an if statement.

def fun(x):
    if (
        x
    ):
        print("got here")

For some reason, the way the if statement is formatted causes the arc description engine to fail to pick up the name of the function. In an LCOV report we get these branch records for line 2:

BRDA:2,0,jump to line 5,-
BRDA:2,0,jump to the function exit,-

The smallest change that makes the problem go away is to move the token x to line 2 without changing anything else, i.e.

def fun(x):
    if (x

    ):
        print("got here")

Then the branch records correctly identify the function:

BRDA:2,0,jump to line 5,-
BRDA:2,0,return from function 'fun',-

Probably related to #1874.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions