I am using lcov (version 1.14) and cobertura to generate a coverage analysis on our C++ code. (gcc version 4.9)
After modifying the code, the code coverage went down inexplicably. Although we did not touch or remove any tests.
For example, line coverage dropped from 2540/2987 to 1597/3082.
On the report, we can see that certain source files are completely not tested, although the corresponding tests are run and are successful.
The commands I'm running are
lcov --directory . --base-directory $BUILD_DIR --capture --output-file $BUILD_DIR/code-coverage.lcov --gcov-tool gcov492
lcov --remove $BUILD_DIR/code-coverage.lcov '*/usr/include/*' '*/thirdparty/*' '*/test/*' $EXTRA_EXCLUDE --output-file $BUILD_DIR/filtered-code-coverage.lcov
lcov_cobertura.py -d $BUILD_DIR/filtered-code-coverage.lcov -o $BUILD_DIR/coverage.xml -b /data$SRC_DIR
I am getting the following warning and wondering if this is the problem:
lcov: WARNING: negative counts found in tracefile /build_dir/code-coverage.lcov
Can anybody help me makes sense of what is going on? Is this a configuration issue? Or is the problem with the commands I'm calling? Or is it actually lcov who is not working properly?