-
Notifications
You must be signed in to change notification settings - Fork 203
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
C++ code coverage support #905
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
harrism
added
non-breaking
Non-breaking change
improvement
Improvement / enhancement to an existing function
labels
Nov 4, 2021
rongou
approved these changes
Nov 4, 2021
robertmaynard
approved these changes
Nov 9, 2021
@gpucibot merge |
ajschmidt8
approved these changes
Nov 9, 2021
rapids-bot bot
pushed a commit
that referenced
this pull request
Dec 1, 2021
Now that #905 added C++ code coverage support, this PR improves test coverage. Much of the improvement comes from adding a new `adaptor_test.cpp` which generically tests the common functions of all 7 adaptor types. Small test additions improve coverage of many other files as well. At least one typo bug was uncovered and fixed. If you build with `-DCODE_COVERAGE=ON -DRMM_LOGGING_LEVEL=TRACE`, overall code coverage is now 99.5% and all but one file has 100% coverage. That one file, arena.hpp is undergoing work concurrent to this PR, and improvement to 100% requires additional testing that might be best undertaken by @rongou, so I will leave it. ![image](https://user-images.githubusercontent.com/783069/143160783-aecda008-2d7d-4ceb-8982-34bb1a35174c.png) Authors: - Mark Harris (https://github.com/harrism) Approvers: - Robert Maynard (https://github.com/robertmaynard) - Rong Ou (https://github.com/rongou) - Jake Hemstad (https://github.com/jrhemstad) URL: #920
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CMake
conda
cpp
Pertains to C++ code
improvement
Improvement / enhancement to an existing function
non-breaking
Non-breaking change
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a cmake option (
CODE_COVERAGE
) to compile a build with relevant options to GCC and NVCC to generate code coverage profiling.This can then be used with coverage tools like
gcovr
or coveralls to generate a detailed coverage summary (e.g. in HTML, JSON, XML, etc.).Also adds a gcovr.cfg with basic options and a conda dependency on gcovr.
Finally, it adds some explicit template instantiations in test files to ensure all template class methods are included in coverage analysis (so coverage % isn't artificially high).(reserved for future PR)Instructions for generating code coverage
Note that parallel building should not be used, because
--keep
is used with .cu files.With rapids-compose, just set build type to Debug in .env, then
Then open
build/debug/coverage/coverage_details.html
. It looks like this:Summary of changes required to get good coverage analysis:
--coverage,-fprofile-abs-path,-fkeep-inline-functions,-fno-elide-constructors
and link with--coverage
.--keep
(otherwise gcov gets errors finding NVCC's deleted intermediate-stage files)Explicitly instantiate template classes at least once in test source files. This ensures any unused methods in these classes get shown as not covered by tests.Reserved for a future PR to improve code coverage.