Skip to content

Conversation

morganga
Copy link

@morganga morganga commented Oct 21, 2022

assert statement coverage should be considered complete if the assert statement was visited. There's no need to track multiple branches at the assert statement.

This is in agreement with the previously reported issue #324, which suggested "They should not be treated as code instructions."

I've extended the ignored instructions to include the assert statement check. This will make coverage complete with or without assertions enabled.

@morganga
Copy link
Author

before fix:
image
after fix:
image

@morganga
Copy link
Author

morganga commented Oct 21, 2022

An alternative solution to AssertFilter: 62

output.ignore(start, ((JumpInsnNode) cursor).label);

results in this report, where they're not even considered coverage lines:
image

@ice1000
Copy link
Contributor

ice1000 commented Jan 19, 2023

I love that

@Cybermite
Copy link

Going to bump this and see if we can get it looked at and merged?

This has been the main reason why our team hasn't migrated off of clover.

@gredler
Copy link

gredler commented Oct 2, 2024

Does anyone know why the JDK 21 and 22 builds failed for this PR? Can somebody trigger the builds again? The failed builds no longer exist on Azure, so there's no telling what happened, AFAICT.

@ice1000
Copy link
Contributor

ice1000 commented Nov 19, 2024

This would be really nice to have!

@ice1000
Copy link
Contributor

ice1000 commented Dec 15, 2024

I opened #1816. All tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants