lundi 29 février 2016

C++ code coverage on Windows

I develop a C++ project under Windows that is compiled and linked into a static library.

For unit testing I use Catch. I develop my tests in a separate project and throw in the necessary headers and the .lib file from the main project. The tests then become an executable that I can run from the command line after the build process.

What I am missing is some code coverage report. I found a few code coverage tools for C++ online, but a lot seem to work with Linux only. Also I am not sure how to integrate them in my static library/exe build. As the library project needs to compile on Linux aswell, I would prefer a platform independent solution.

Is there a C++ code coverage tool that works on both Windows and Linux (preferrably without having to use a fixed IDE) and which can be integrated into my Catch unit tests workflow?

It is fine if I have to compile/link in some special way in order to be able to run the tests and get coverage.

Aucun commentaire:

Enregistrer un commentaire