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

Skip to content

Conversation

@jbloggz
Copy link
Contributor

@jbloggz jbloggz commented Jun 30, 2023

This PR adds the --cobertura-add-tracefile option to the CLI. This options works just like the existing --json-add-tracefile option, and both options can be used together.
A couple of things to note about importing a Cobertura XML

  • The branch coverage doesn't contain the counts of each branch, it's either 1 or 0
  • The function coverage doesn't align with how gcovr reports function coverage. Cobertura reports the percentage of the function that was covered, not the number of times it was called. For this reason, I excluded importing the function coverage.

resolves #803

This is a draft PR, as I still need to add test cases. However I am unfamiliar with the testing framework used and would appreciate some guidance in writing the tests.

Copy link
Member

@Spacetown Spacetown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments. Please add yourself to the Authors, update the changeling and add a test case.

@jbloggz jbloggz marked this pull request as ready for review July 2, 2023 14:31
@jbloggz jbloggz requested a review from Spacetown July 2, 2023 14:33
@codecov
Copy link

codecov bot commented Jul 12, 2023

Codecov Report

Patch coverage: 86.84% and project coverage change: -0.21% ⚠️

Comparison is base (349608d) 94.44% compared to head (af9b221) 94.24%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #805      +/-   ##
==========================================
- Coverage   94.44%   94.24%   -0.21%     
==========================================
  Files          41       42       +1     
  Lines        4108     4220     +112     
  Branches      809      827      +18     
==========================================
+ Hits         3880     3977      +97     
- Misses        147      158      +11     
- Partials       81       85       +4     
Files Changed Coverage Δ
gcovr/formats/cobertura/read.py 77.27% <77.27%> (ø)
gcovr/formats/__init__.py 85.33% <100.00%> (+0.19%) ⬆️
gcovr/formats/cobertura/__init__.py 100.00% <100.00%> (ø)
gcovr/tests/test_args.py 99.15% <100.00%> (+0.11%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jbloggz jbloggz requested a review from Spacetown July 15, 2023 04:09
Copy link
Member

@Spacetown Spacetown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGFM

@Spacetown Spacetown added this to the Upcoming release milestone Jul 30, 2023
Copy link
Member

@Spacetown Spacetown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please can you add a test case for this?

@jbloggz
Copy link
Contributor Author

jbloggz commented Jul 31, 2023

Please can you add a test case for this?

I did already add a test case. Are you wanting another one? Or are you saying the current test case doesn't have enough coverage?

@Spacetown
Copy link
Member

Sorry, I missed this test.

Copy link
Member

@Spacetown Spacetown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGFM

@Spacetown Spacetown merged commit e65c140 into gcovr:master Aug 27, 2023
@Spacetown Spacetown removed this from the Upcoming release milestone Jan 26, 2024
D-Walther pushed a commit to D-Walther/gcovr that referenced this pull request Jun 16, 2025
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.

Add the ability to import existing coverage reports

2 participants