lcov --directory . --capture --output-file ic.info
genhtml -o html/ ic.info
Now the question. No matter how many times I'm running the executable I'm getting always the same result, i.e. the same coverage of lines and functions. Should it increase the line coverage for every execution ? Do I get something wrong ?
If lcov
generates coverage only for one execution, then how can I generate coverage for all executions that I've done ?
I guess you misunderstand how the coverage results are generated. lcov
is not generating the coverage, as stated in your question. It only processes the coverage results, which are generated when running your program (step 3 in your question).
So, when executing the program multiple times (step 3) your line execution times will increase (not necessary the coverage). To see this you can generated multiple coverage reports (execute step 3,4 and 5 multiple times). You will see an increase in the execution times of lines in your code in the reports generated in step 5.