-
Notifications
You must be signed in to change notification settings - Fork 4
Code coverage support for CacheLib #50
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @guptask)
cachelib/CMakeLists.txt
line 89 at r1 (raw file):
# Add code coverage set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
Can add an option to enable/disable coverage?
Something like:
if(COVERAGE_ENABLED)
# Add code coverage
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
endif()
Previously, igchor (Igor Chorążewicz) wrote…
Done. |
fbcc7eb
to
c6598b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @guptask)
run_code_coverage.sh
line 11 at r2 (raw file):
# Track coverage lcov -c -i -b . -d . -o Coverage.baseline
what is this Coverage.baseline? what does it contain if no tests were run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @guptask)
run_code_coverage.sh
line 3 at r2 (raw file):
#!/bin/bash BUILD_DIR='build-cachelib'
I'm not sure if you should put compilation/installation step here - it would be better for this script to be standalone.
Previously, igchor (Igor Chorążewicz) wrote…
Are you saying it is better to split this into 2 scripts - build_coverage and generate_coverage ? |
Previously, igchor (Igor Chorążewicz) wrote…
Even if you don't run unit tests, the coverage report shows non-zero coverage for few files. I'm not sure exactly why that is the case. These commands allow us to include those coverage stats in the final report. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @guptask)
run_code_coverage.sh
line 3 at r2 (raw file):
Previously, guptask (Sounak Gupta) wrote…
Are you saying it is better to split this into 2 scripts - build_coverage and generate_coverage ?
I mean, I'm not sure if we need the build script at all. We can just document what flag you need to pass to cmake to enable coverage.
run_code_coverage.sh
line 11 at r2 (raw file):
Previously, guptask (Sounak Gupta) wrote…
Even if you don't run unit tests, the coverage report shows non-zero coverage for few files. I'm not sure exactly why that is the case. These commands allow us to include those coverage stats in the final report.
Ok, got it.
Fix issue with "Destorying an unresolved handle"
Packages needed are lcov and genhtml.
Coverage requires addition of new compile and linker flags. It can be encapsulated as an option. Currently it is the hard-coded.
This change is