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

When invoked with --calls, show call coverage #666

Merged
merged 26 commits into from Sep 28, 2022
Merged

When invoked with --calls, show call coverage #666

merged 26 commits into from Sep 28, 2022

Conversation

odkq
Copy link
Contributor

@odkq odkq commented Aug 31, 2022

Show them in summary writer. Total number of function calls and number
of calls executed.

HTML view: Show number of calls for each source file and the number of
them executed.

HTML view: In the source view, show the number of calls and executed calls for each
line in their own column.

Show them in summary writer. Total number of function calls and number
of calls executed.

HTML view: Show number of calls for each source file and the number of
them executed.

HTML view: In the source view, show the number of calls and executed calls for each
line in their own column.
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 minor changes needed. Please add also test data for this as described in the documentation.

gcovr/coverage.py Outdated Show resolved Hide resolved
gcovr/templates/root_page.html Show resolved Hide resolved
gcovr/coverage.py Show resolved Hide resolved
gcovr/templates/root_page.html Show resolved Hide resolved
gcovr/templates/source_page.html Outdated Show resolved Hide resolved
@odkq odkq marked this pull request as draft August 31, 2022 19:36
@odkq
Copy link
Contributor Author

odkq commented Aug 31, 2022

Added a test case at tests/calls with a reference output for gcc 11 at 3640cd5

@odkq odkq marked this pull request as ready for review August 31, 2022 20:49
@odkq odkq requested a review from Spacetown August 31, 2022 21:00
@Spacetown
Copy link
Member

Reference is needed for all compilers. After the pipeline there will be an artifact for every compiler. If you have Docker installed you can create also the reference data locally.

@Spacetown
Copy link
Member

Please update the changelog and the authors.

@Spacetown
Copy link
Member

Whole HTML reference needs to be updated. I'm currently not able to do this. Do you have Docker installed on your computer?

@odkq
Copy link
Contributor Author

odkq commented Sep 1, 2022

Whole HTML reference needs to be updated. I'm currently not able to do this. Do you have Docker installed on your computer?

I do, but when I run python3 -m nox --session 'docker_qa_compiler(all)' -- --update_reference I get
nox > Ran multiple sessions:
nox > * docker_qa_compiler(all): success
nox > * docker_qa_compiler(gcc-5): success
nox > * docker_qa_compiler(gcc-6): success
nox > * docker_qa_compiler(gcc-8): success
nox > * docker_qa_compiler(gcc-9): success
nox > * docker_qa_compiler(gcc-10): success
nox > * docker_qa_compiler(gcc-11): success
nox > * docker_qa_compiler(clang-10): success
nox > * docker_qa_compiler(clang-13): success
nox > * docker_qa_build_compiler(gcc-5): success
nox > * docker_qa_run_compiler(gcc-5): failed
nox > * docker_qa_build_compiler(gcc-6): success
nox > * docker_qa_run_compiler(gcc-6): failed
nox > * docker_qa_build_compiler(gcc-8): success
nox > * docker_qa_run_compiler(gcc-8): failed
nox > * docker_qa_build_compiler(gcc-9): success
nox > * docker_qa_run_compiler(gcc-9): failed
nox > * docker_qa_build_compiler(gcc-10): success
nox > * docker_qa_run_compiler(gcc-10): failed
nox > * docker_qa_build_compiler(gcc-11): success
nox > * docker_qa_run_compiler(gcc-11): failed
nox > * docker_qa_build_compiler(clang-10): success
nox > * docker_qa_run_compiler(clang-10): failed
nox > * docker_qa_build_compiler(clang-13): success
nox > * docker_qa_run_compiler(clang-13): failed

Somehow it is failing before (?) getting the new references?

@Spacetown
Copy link
Member

Spacetown commented Sep 1, 2022

The error messages should be above the summary of nox If you run python3 -m nox --session 'docker_qa_compiler(gcc-5)' -- --update_reference you get the error faster.

@odkq
Copy link
Contributor Author

odkq commented Sep 5, 2022

It looks like a problem in nox/docker in my setup:
nox > docker run --rm -e CC -e NOX_POSARGS -e NOX_OPTIONS -v /home/user/gcovr:/gcovr gcovr-qa-ubuntu_18.04-gcc-5-uid_1000
Running chmod with sudo...chown: cannot read directory '/gcovr/gcovr': Permission denied

I've tried in a Fedora 36 vm installing everything from scratch (python-nox, docker) and it also happens.

What is the recommended environment/distribution to run docker to retrieve the reference files?

@Spacetown
Copy link
Member

It looks like a problem in nox/docker in my setup: nox > docker run --rm -e CC -e NOX_POSARGS -e NOX_OPTIONS -v /home/user/gcovr:/gcovr gcovr-qa-ubuntu_18.04-gcc-5-uid_1000 Running chmod with sudo...chown: cannot read directory '/gcovr/gcovr': Permission denied

I've tried in a Fedora 36 vm installing everything from scratch (python-nox, docker) and it also happens.

What is the recommended environment/distribution to run docker to retrieve the reference files?

I've only used it on MacOs. Can you try to modify the noxfile.py to use /home/user/gcovr:/gcovr:rw instead of /home/user/gcovr:/gcovr?

@odkq
Copy link
Contributor Author

odkq commented Sep 5, 2022

Copied the changed reference files for all tests from a succesful run in Ubuntu 18.04 vm

@codecov
Copy link

codecov bot commented Sep 7, 2022

Codecov Report

Base: 95.24% // Head: 95.28% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (c316796) compared to base (398aaff).
Patch coverage: 98.64% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #666      +/-   ##
==========================================
+ Coverage   95.24%   95.28%   +0.03%     
==========================================
  Files          24       24              
  Lines        3409     3479      +70     
  Branches      642      657      +15     
==========================================
+ Hits         3247     3315      +68     
- Misses         91       92       +1     
- Partials       71       72       +1     
Flag Coverage Δ
ubuntu-18.04 94.01% <98.64%> (+0.06%) ⬆️
windows-2019 94.93% <98.63%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gcovr/configuration.py 99.36% <ø> (ø)
gcovr/tests/test_args.py 98.86% <ø> (ø)
gcovr/gcov_parser.py 98.98% <90.00%> (-0.50%) ⬇️
gcovr/coverage.py 99.06% <100.00%> (+0.10%) ⬆️
gcovr/gcov.py 75.96% <100.00%> (+0.18%) ⬆️
gcovr/merging.py 84.21% <100.00%> (+1.25%) ⬆️
gcovr/writer/html.py 95.29% <100.00%> (+0.30%) ⬆️
gcovr/writer/json.py 97.01% <100.00%> (+0.26%) ⬆️
gcovr/writer/summary.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Spacetown
Copy link
Member

Copied the changed reference files for all tests from a succesful run in Ubuntu 18.04 vm

Shall I update the reference for you?

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.
Only some minor annotations. If everything is done the test data needs to be updated.

@latk I leave it up to you which PR is merged first, this one or your refactoring of the parser..

gcovr/writer/json.py Show resolved Hide resolved
gcovr/writer/json.py Outdated Show resolved Hide resolved
Updated json version to 0.4 as a new key was added (gcovr/calls)
gcovr/merging.py Outdated Show resolved Hide resolved
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. Thank you for working on this.

@Spacetown Spacetown merged commit b5103e1 into gcovr:master Sep 28, 2022
@odkq
Copy link
Contributor Author

odkq commented Oct 3, 2022

LGFM. Thank you for working on this.

Thank you for the great support and codebase!

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.

None yet

3 participants