This project is read-only.

Feature request: aggregated statistic (per module/per file) in cobertura report

Nov 28, 2015 at 10:54 AM
Hi!

First, thans for great tool! I am using it extensively in my work process.

I have some feature request:
Typical cobertura report contains not only information about how many times each line was covered, but also aggregated coverage percentage per file/module.
(some example cobertura report: https://raw.githubusercontent.com/jenkinsci/cobertura-plugin/master/src/test/resources/hudson/plugins/cobertura/coverage-with-data.xml).

Could you make cobertura report generated by OpenCppCoverage work same way?
i.e. add line-rate properties on package and class level.

From what I am seeing from the code it should be quite easy (you already have CoverageRateComputer).

Actually I even can implement this feature by myself, if you are accepting contributions.

Please share your thoughts.
Dec 7, 2015 at 11:56 AM
Hi,

Now, there is no support to count the number of times a line is executed. It is not complicated, but impact a lot of code and tests. This feature can also be useful for HTML report and required some additional development.

As adding line count can be useful, I will try to add this feature in OpenCppCoverage 0.9.5 (0.9.4 is in testing phase and will be release very soon).

Thanks for proposing contributions, but the project is not yet ready for that (I should move to Github) and adding line count is not trivial.
I will update this discussion so that you will know when the feature will be ready.
Hope that help,

OpenCppCoverage
Dec 7, 2015 at 1:43 PM
Edited Dec 7, 2015 at 1:44 PM
Hi,

I think there is some misunderstanding here:
I actually don't need exact information about how many times line was covered (instead of just covered/uncovered). I just want to have aggregated stats in xml report. Basically right now report is
            <class name="...." filename=".....">
                <lines>
                    <line number="1" hits="1"/>
                    <line number="2" hits="1"/>
                    <line number="3" hits="0"/>
                </lines>
            </class>
and I want it to be
            <class name="...." filename="....." line-rate="0.66666">
                <lines>
                    <line number="1" hits="1"/>
                    <line number="2" hits="1"/>
                    <line number="3" hits="0"/>
                </lines>
            </class>
Dec 7, 2015 at 8:59 PM
Hi,

Thanks for your additional information.
Indeed, this is something a lot easier to do. I will try to add it in OpenCppCoverage 0.9.4 that should be released soon.

OpenCppCoverage
Dec 17, 2015 at 3:32 PM
Hello,

The line-rate feature is now available: https://opencppcoverage.codeplex.com/releases/view/618947.

Please let me know if it does not work as you expect.

OpenCppCoverage
Dec 18, 2015 at 5:00 PM
Hi,

Yes, it does, many thanks!

Just some additional idea: probably it's good idea to show overall coverage (<coverage line-rate="0.9">)
Apr 19, 2016 at 12:25 PM
Hello,

The overall coverage is available in OpenCppCoverage 0.9.5 (https://opencppcoverage.codeplex.com/releases/view/620819)

OpenCppCoverage
Marked as answer by OpenCppCoverage on 6/11/2016 at 6:39 AM