Skip to content
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

Fix error on negative counts with no function_name. #100

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

wsnyder
Copy link
Contributor

@wsnyder wsnyder commented Jul 26, 2024

This fixes a crash with negative counts. Also fixes some extraneous trailing spaces.

The backtrace this solved is as follows:

Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/.../fastcov.py", line 335, in gcovWorker
    distillSource(f, base_report["sources"], args.test_name, args.xbranchcoverage)
  File "/.../fastcov.py", line 714, in distillSource
    distillLine(line, sources[source_name][test_name]["lines"], sources[source_name][test_name]["branches"], include_exceptional_branches)
  File "/.../fastcov.py", line 677, in distillLine
    logging.warning("Ignoring negative count found in %s.", line_raw["function_name"])
KeyError: 'function_name'

@RPGillespie6
Copy link
Owner

Nice catch, thanks for the fix.

@RPGillespie6 RPGillespie6 merged commit 81e7c96 into RPGillespie6:master Jul 26, 2024
1 check passed
@wsnyder wsnyder deleted the negative branch July 26, 2024 15:18
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.

2 participants