[Bro-Dev] bro and code coverage

Seth Hall seth at icir.org
Mon Dec 13 10:21:31 PST 2010


On Dec 13, 2010, at 11:31 AM, Jonathan Siwek wrote:

>    CFLAGS="-fprofile-arcs -ftest-coverage" CXXFLAGS="-fprofile-arcs -ftest-coverage" ./configure
> 
> Passing the flags only works for the first-time configure of a given build directory.

Ah, that would actually work fine then.  It seems like it would mostly be used for the automated tests (after we make sure we have tests that hit the code paths in the first place) to make sure that we continue to hit all code paths possible with our tests and we could use it provide assurance that we continue to hit new code paths in our tests.

> The lcov doc you referenced also mentioned linking to -lgcov.  If something like that's necessary, it probably makes sense to add a --enable-code-coverage option to the configure wrapper that triggers CMake to search for the required stuff and, if it's all there, add the necessary compile and link flags, else fail.

lcov isn't required for gcov, it just generates the nice html output from the raw gcov files but for the automated tests I imagine that we would just use the gcov generated files.  It's probably good to avoid stuffing too many options in the configure script anyway.

  .Seth


More information about the bro-dev mailing list