8000 Fix type error in decision analysis by genossefloyd · Pull Request #784 · gcovr/gcovr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix type error in decision analysis #784

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

Merged

Conversation

genossefloyd
Copy link
Contributor

Proposal for fix of #783
Avoiding TypeError exception if self.coverage.lines is empty during decision analysis

@Spacetown
Copy link
Member

Thank you for fixing this. Can you also extend the decision test to raise this exception without your fix?

@Spacetown Spacetown added this to the Upcoming release milestone May 18, 2023
@codecov
Copy link
codecov bot commented May 18, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% 🎉

Comparison is base (b7858fc) 95.61% compared to head (2527c5b) 95.63%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #784      +/-   ##
==========================================
+ Coverage   95.61%   95.63%   +0.01%     
==========================================
  Files          40       41       +1     
  Lines        4041     4082      +41     
  Branches      793      806      +13     
==========================================
+ Hits         3864     3904      +40     
  Misses        100      100              
- Partials       77       78       +1     
Files Changed Coverage Δ
gcovr/decision_analysis.py 90.21% <100.00%> (+1.45%) ⬆️

... and 5 files with indirect coverage changes

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

@genossefloyd
Copy link
Contributor Author
genossefloyd commented May 24, 2023

I have extended the decisions test with a setup using a second cpp that is raising the issue, but only for clang (14) and not for gcc (10).

The two failing test cases require an update of the json and html output reference. The "--update-reference" command did not work for me... I also do not have all the required build environments. Could you straigthen out these references yourself?

@Spacetown
Copy link
Member

The "--update-reference" command did not work for me...

The switch is written with a _and not a - in the middle.

The change in the makefile is not working for us. Can you modify the test to use a enumeration in the same C-File without adding another compile unit?
I guess the problem is the scope operator in the case value.

@genossefloyd
Copy link
Contributor Author
genossefloyd commented May 24, 2023

I tried different switch-variations (with break, return, additional brackets, ...) to make it come up with one cpp but it does not work. There have to be two cpp's.

As far as I understood it, the code in one cpp is creating some actual coverage of the switch statement, the other one only references the containing class but does not call the relevant function, so it ends up with 0 coverage and we end up with an empty list.

I have no real insights on how gcov works exactly but that is my best guess about whats happening after trying several setups half of the day.

As I am a bit out of time/resources to investigate the problem any further, I can not continue working on it - at least for the next couple of weeks. Sorry about that.

@Spacetown Spacetown force-pushed the fix_type_error_in_decision_analysis branch from 5f44370 to 8494dd9 Compare July 30, 2023 21:09
@Spacetown Spacetown force-pushed the fix_type_error_in_decision_analysis branch from daa1893 to 585bb88 Compare July 30, 2023 21:31
@Spacetown Spacetown force-pushed the fix_type_error_in_decision_analysis branch from c6eb6c8 to 2527c5b Compare August 6, 2023 20:05
@Spacetown Spacetown merged commit e6fc434 into gcovr:master Aug 6, 2023
@Spacetown Spacetown removed this from the Upcoming release milestone Jan 26, 2024
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.

2 participants
0