-
Notifications
You must be signed in to change notification settings - Fork 240
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
[question] Why only one braces is not covered in my project? #160
Comments
gcov artifact. My workaround is to filter the coverage data - in this case, to remove spurious zero counts from the function closing brace. Hope that helps. |
Hi, Im searching for this "remove zero counts from the function closing braces", but im not finding how to solve this for all files. I found:
How i can do it globally (from command line or something like this)? Thanks. |
From #86, you will find a few references to "--filter" - but it looks like the bug report for #129 already refers to it.
(edited to remove screen shot that did not translate :-( )
The page refers to my branch of the lcov repo.
At present: you will need to download that branch if you want to use the feature.
It is in the process of being merged to master – but the merge is not yet complete/not available.
You _do_ need to be able to install that new version (somewhere – possibly in your own account if you don’t have sufficient permission and/or your IT group does not agree).
I hope this helps.
Henry
|
As I remember, codecov scripts upload coverage information to their servers for processing. So you want to consult their documentation for some kind of filtering and if that's not present suggest ignoring coverage information on lines like |
Fixing lcov won't fix codecov. |
But codecov use the lcov data. It shows exactly the same data from lcov. |
Both codecov and lcov use data from gcov. There is no need to use lcov for codecov, it will only make things harder. |
* Both codecov and lcov use data from gcov. There is no need to use lcov for codecov, it will only make things harder.
I’m unfamiliar with ‘codecov’.
However, if it is using the data format that is also used by ‘lcov’ – then you can use the various features (such as filtering) mentioned earlier to munge the data and then feed to codecov.
It is also possible to simply port the new features into codecov – but that seems kinda boring/repetitive.
Henry
|
* So you want to consult their documentation for some kind of filtering and if that's not present suggest ignoring coverage information on lines like } to them. I doubt they are using lcov at all.
I forgot to mention that you probably don’t want to blindly ignore close-brace lines with hit counts on them, as sometimes they are relevant and sometimes not.
For example:
if (cond) {
} <- 0 hit count here means branch not taken/condition not executed
Similarly,
void foo() {
// … body removed
if (return_now) {
return;
}
} <- zero hit count probably means previous branch always taken
… so context matters – and can get complicated (so the filter I implemented gives up).
It is also true that the above examples are probably better handled by branch coverage metrics – but branch coverage has it own issues with bogosity.
To really do a good job of filtering – you need to be a compiler. And if it was easy, gcc/llvm would likely already do it 😊
Henry
|
The "--filter ..." features described above have been merged. Could you test the current TOT to see if it meets your requirements or not. |
@paulocoutinhox In case you still got this issue, try adding the compile options |
No comments/no followup for quite some long period. I'm closing this issue. If there is still a problem: please either reopen this one or file a new issue. Please provide detailed description of problem - ideally with a small testcase which exhibits the issue. Thanks |
Hi,
In my project appear in report that only one braces is not covered:
https://app.codecov.io/gh/nativium/nativium/blob/main/modules/app-core/implementation/cpp/nativium/core/ApplicationCoreImpl.cpp
Why this happen?
Thanks.
The text was updated successfully, but these errors were encountered: