Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Spacetown
Copy link
Member

@Spacetown Spacetown commented Sep 29, 2024

Add function level coverage to coveralls and HTML report. This is only available if gcov JSON intermediate format version 2 is used (available since gcc-14).

Closes #654

Both are now mandatory arguments to show clearly where the information
is missing. If mangled name is available use it as dict key instead of
the demangled name because for a virtual function there are two entrie
with same demangled name in gcov JSON outout:

```
                {
                    "name": "_ZN3BarD0Ev",
                    "demangled_name": "Bar::~Bar()",
                    "start_line": 9,
                    "start_column": 13,
                    "end_line": 10,
                    "end_column": 6,
                    "blocks": 3,
                    "blocks_executed": 0,
                    "execution_count": 0
                },
                {
                    "name": "_ZN3BarD2Ev",
                    "demangled_name": "Bar::~Bar()",
                    "start_line": 9,
                    "start_column": 13,
                    "end_line": 10,
                    "end_column": 6,
                    "blocks": 1,
                    "blocks_executed": 1,
                    "execution_count": 1
                },
````
@codacy-production
Copy link

codacy-production bot commented Sep 29, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.02% (target: -1.00%) (target: 95.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (2375572) 4146 4055 97.81%
Head commit (98abd77) 4176 (+30) 4085 (+30) 97.82% (+0.02%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#975) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@Spacetown Spacetown merged commit 97e51f1 into gcovr:main Sep 30, 2024
34 checks passed
@Spacetown Spacetown deleted the add_function_coverage branch September 30, 2024 05:15
@Spacetown Spacetown removed this from the Upcoming release milestone Oct 8, 2024
D-Walther pushed a commit to D-Walther/gcovr that referenced this pull request Jun 16, 2025
* Add function to get a filtered by function file coverage
* Add function coverage to HTML report
* Add function coverage to cobertura report
* Change order of name and demangled_name in data

Both are now mandatory arguments to show clearly where the information
is missing. If mangled name is available use it as dict key instead of
the demangled name because for a virtual function there are two entrie
with same demangled name in gcov JSON outout:

```
                {
                    "name": "_ZN3BarD0Ev",
                    "demangled_name": "Bar::~Bar()",
                    "start_line": 9,
                    "start_column": 13,
                    "end_line": 10,
                    "end_column": 6,
                    "blocks": 3,
                    "blocks_executed": 0,
                    "execution_count": 0
                },
                {
                    "name": "_ZN3BarD2Ev",
                    "demangled_name": "Bar::~Bar()",
                    "start_line": 9,
                    "start_column": 13,
                    "end_line": 10,
                    "end_column": 6,
                    "blocks": 1,
                    "blocks_executed": 1,
                    "execution_count": 1
                },
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Method level coverage in the xml generated

1 participant