OpenCppCoverage / OpenCppCoverage

OpenCppCoverage is an open source code coverage tool for C++ under Windows.
GNU General Public License v3.0
884 stars 149 forks source link

Create a separate Line Counter program #69

Open bert8128 opened 5 years ago

bert8128 commented 5 years ago

Before creating an issue, please make sure the answer is not in the FAQ.

This template is applied for all bug requests. Remove it for other general question or feature request.

Describe your environment

I have a number of projects which, for various reasons, are not currently included in the program which runs the unit tests. It would be very useful if I could nevertheless get a line count from those projects so that I could get a better view of my overall coverage. So if I had two projects Xprj and Yprj, each with one file in each (X.xpp and Y.cpp), each with 100 lines of code, and my test program only tested Xprj, I would like to know that I was only 50% covered, not 100% covered, even if this was done after the coverage program had run.
I can of course calculate a line count myself, but it would be useful if this was done in the same way as the coverage calculates it.
So ideally I would like a separate program that I could point out Xprj and Yprj together to give 200 as the total line count. Thanks

OpenCppCoverage commented 5 years ago

Hello,

You are not the first one to have this use case so I will try to provide a way to do it! Does it help if OpenCppCoverage will have a way to include another project with the PDB file (--extra_pdg=MyProject2.pdb)?

Note: You need to be a little patient: https://github.com/OpenCppCoverage/OpenCppCoverage/issues/72

OpenCppCoverage

bert8128 commented 5 years ago

I'm not too fussed how I get there, so adding extra PDBs to the command line would probably be fine. Perhaps even good - it would mean that one run would get all the data and I wouldn't have to do anything outside. Thanks.