Why is a "Baseline" step needed for LCOV to get "correct" results?

72 Views Asked by At

man lcov says:

--initial Capture initial zero coverage data.

Run lcov with -c and this option on the directories containing .bb, .bbg or .gcno files before running any test case. The result is a "baseline" coverage data file that contains zero coverage for every instrumented line. Combine this data file (using lcov -a) with coverage data files captured after a test run to ensure that the percentage of total lines covered is correct even when not all source code files were loaded during the test.

What does it mean that "not all source code files were loaded during the test", and what does "incorrect" percentages mean? Do they mean constructor calls that are not actually part of the tests but part of the tested libraries?

0

There are 0 best solutions below