[CMake] gcov results not accurate

Andy Lego legoandy at gmail.com
Thu Mar 5 14:34:19 EST 2009


Hello David,

Unfortunately there is no really good way for CTest to guess all the lines
from the source code. We use GCov output, which contains the actual lines
and their corresponding coverage. If the file is not used, then GCov will
not contain any information and therefore it will be ignored.

So, as I said, we cannot just take the whole file, since the file will
contain comments, empty lines, etc. I guess we could write a simple C++
parser (no such thing) that would parse files and remove comments and other
useless things, but that would be way too complicated.

Hope that helps.

Andy

On Thu, Mar 5, 2009 at 11:28 AM, David Blado <dblado at decarta.com> wrote:

>  Hi All,
>
>
>
> Some colleagues and myself are in the process of wiring in coverage reports
> through CTest and CDash.  We have noticed that the percentage of code
> covered is not including source files for which no tests exist.  The
> percentage isn’t accurate because if our library has 8 source files and only
> 2 of those files contain functions that are hit by the unit tests, the
> percentage is only calculated for those two files.
>
>
>
> We have found our that using a CTestCustom.cmake (with
> CTEST_CUSTOM_COVERAGE_EXCLUDE) we can exclude our test source code from the
> percentage, but not include additional sources.  Is there a solution to this
> other than to ensure that at least one function / file is exercised by the
> unit tests?
>
>
>
> Cheers,
>
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Lets bike the world together
http://legoandy.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090305/7a8f2d35/attachment.htm>


More information about the CMake mailing list