"Jump to the function exit" in lcov report with multiline conditional
Closed this issue · 2 comments
zackw commented
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 commented
This is now released as part of coverage 7.6.10.