-
Notifications
You must be signed in to change notification settings - Fork 263
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
Cobertura: missing support for function coverage #843
Comments
It still true since we do not have full information needed for the report.
This example is invalid according to the DTD: gcovr/gcovr/tests/cobertura.coverage-04.dtd Lines 41 to 46 in f42ab8f
The Related #654 . |
For the record, my example was from the cobertura report generated by istanbuljs. It is indeed not compliant with the spec, but it's working with report parsers and visualizers that we have tried (namely, ReportGenerator). Of course I would like for gcovr to be compliant with the spec, and I'm looking forward for this kind of support. |
There is already an issue since Apr 2021 related to the wrong report format, see istanbuljs/istanbuljs#603. ReportGenerator doesn't validate input against the DTD. It only uses the expected arguments and ignores additional ones. The reports generated by the tool are DTD conform. |
Well, apparently there's an alternative spec, which is less strict: https://github.com/cobertura/cobertura/blob/master/cobertura/src/site/htdocs/xml/coverage-loose.dtd |
Currently Cobertura reporter does not fill the
<methods>
element, leaving it blank. The reasoning for that is as folows:gcovr/gcovr/formats/cobertura/write.py
Lines 73 to 75 in f42ab8f
I'm not sure if this rationale still holds? By looking at JSON output there seems to be a list of functions for each file, including their line numbers.
So probably the Cobertura reporter can be updated to support functions?
If so, then the correct output would be as follows:
The text was updated successfully, but these errors were encountered: