Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zackw opened this issue Oct 9, 2024 · 2 comments
Closed

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

zackw opened this issue Oct 9, 2024 · 2 comments
Labels
bug Something isn't working fixed

Comments

@zackw
Copy link
Contributor

zackw commented Oct 9, 2024

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.

@nedbat
Copy link
Owner

nedbat commented Dec 24, 2024

This is fixed in commit c85eaba.

@nedbat nedbat closed this as completed Dec 24, 2024
@nedbat nedbat added the fixed label Dec 24, 2024
@nedbat
Copy link
Owner

nedbat commented Dec 26, 2024

This is now released as part of coverage 7.6.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants