generating branch coverage data for lcov

后端 未结 4 577
旧巷少年郎
旧巷少年郎 2021-02-02 11:44

i\'m trying to use lcov for code coverage metrics, but I cannot get branches coverage to work.

Here\'s how i\'m using it:

g++ -ggdb3 --coverage src/read.         


        
4条回答
  •  臣服心动
    2021-02-02 12:34

    .lcovrc files is file of settings that need to place in path of lcov file. Frankly, I didn't research much on use of this file.

    You need to add additional parameter as "--rc lcov_branch_coverage=1" to lcov for all calls. In your case add this parameter to all your three calls. If you miss one, it will drop branch coverage.

    Also --branch-coverage is needed for genhtml.

提交回复
热议问题