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

Consider codecov.io for coverage evaluation #247

Closed
fedorov opened this issue May 9, 2017 · 8 comments
Closed

Consider codecov.io for coverage evaluation #247

fedorov opened this issue May 9, 2017 · 8 comments

Comments

@fedorov
Copy link
Member

fedorov commented May 9, 2017

There are examples that show how to use it with C++ and with cmake:

https://docs.codecov.io/docs/supported-languages

@jcfr
Copy link
Contributor

jcfr commented May 9, 2017

We have been using it in most of our python projects.

It is also now used to report ITK coverage (cc: @thewtex). Initially it was not working, too much date for their infrastructure. They were very responsive in improving their infrastructure so that it can process all ITK coverage files.

@thewtex
Copy link
Contributor

thewtex commented May 9, 2017

FYI, here are the scripts we use for ITK:

@fedorov
Copy link
Member Author

fedorov commented May 10, 2017

@jcfr @thewtex thanks a lot for following up on this topic! Your suggestions should be very helpful when we get to this.

@fedorov
Copy link
Member Author

fedorov commented May 15, 2017

@jcfr @thewtex

I was able to do some coverage testing by following the pointers you gave me. Here's what I did:

  1. sudo apt-get install lcov on my local Ubuntu
  2. set manually CMAKE_C_FLAGS and CMAKE_CXX_FLAGS to -g -O0 -fprofile-arcs -ftest-coverage, set CTEST_COVERAGE_COMMAND="/usr/bin/lcov".
  3. configured and super-built dcmqi
  4. discovered that flags were not propagated to the inner build (@jcfr - is this expected or a bug?), re-ran cmake with the flags above in the inner build, rebuilt
  5. ran ctest
  6. captured coverage info: lcov --directory . --capture --output-file coverage.info
  7. manually uploaded coverage report to codecov

The result is here: https://codecov.io/gh/QIICR/dcmqi

Do you have any idea why the only files shown in the report are the CLP headers and itkImageIOFactoryRegisterManager.h?

I also realized I did not set LDFLAGS env - not sure if it changes anything, but will test that later.

@che85 che85 self-assigned this Jun 16, 2017
@fedorov
Copy link
Member Author

fedorov commented Jun 26, 2017

Coveralls is another option: https://coveralls.zendesk.com/hc/en-us/articles/201342799-C-C-

@fedorov
Copy link
Member Author

fedorov commented Jun 26, 2017

I made some progress.

Relevant cmake variables (make sure these are in the inner dcmqi-build folder):

CMAKE_CXX_FLAGS:STRING=-g -O0 -fprofile-arcs -ftest-coverage
CMAKE_C_FLAGS:STRING=-g -O0 -fprofile-arcs -ftest-coverage
CMAKE_EXE_LINKER_FLAGS:STRING=-fprofile-arcs -ftest-coverage
CMAKE_MODULE_LINKER_FLAGS:STRING=-fprofile-arcs -ftest-coverage
CMAKE_SHARED_LINKER_FLAGS:STRING=-fprofile-arcs -ftest-coverage

After running ctest ., run lcov in the inner build folder:

$ lcov --directory . --capture --output-file o.lcov

Clean up the output:

$ lcov --remove o.lcov '/usr/*' 'dcmqi-build/*' --output-file o_clean.lcov

Generate html view:

$ genhtml -o o_clean.html o_clean.lcov 

Result in o_clean.html/index.html:

image

The bad news that I still cannot make sense out of the Codecov reported coverage. Without changing anything (presumably, same gcov reports should be used), and running

$ bash <(curl -s https://codecov.io/bash) -X gcov -B master -C <token>

I am getting the same result in Codecov, which makes no sense to me, and is not consistent with what I get with genhtml:

image

@fedorov
Copy link
Member Author

fedorov commented Jun 26, 2017

Coveralls is another option: https://coveralls.zendesk.com/hc/en-us/articles/201342799-C-C-

cpp-coveralls appears to be unable to handle gcov output generated for our code. Issue reported: eddyxu/cpp-coveralls#116

@fedorov
Copy link
Member Author

fedorov commented Jun 29, 2017

Making some progress understanding how this is supposed to work ...

image

@che85 che85 assigned fedorov and unassigned che85 Jul 3, 2017
@fedorov fedorov closed this as completed in b51e0dc Jul 3, 2017
fedorov added a commit to fedorov/dcmqi that referenced this issue Jul 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants