With gcov, is it possible to merge to .gcda files?

后端 未结 4 1355
走了就别回头了
走了就别回头了 2020-12-09 20:58

I have the same source files (C and Obj-C) being compiled into two targets: the unit test executable and the actual product (which then gets integration tested). The two tar

4条回答
  •  自闭症患者
    2020-12-09 21:37

    Finally I managed to solve my problem by means of lcov.

    Basically what I did is the following:

    • Compile the application with the flags -fprofile-arcs -ftest-coverage --coverage
    • Distribute the copy of the application to each node.
    • Execute the application in each node in parallel. (This step generates into the application directory in the access host the coverage information)
    • Let lcov make his work:
      • lcov --directory src/ --capture --output-file coverage_reports/app.info
    • Generate the html output:
      • genhtml -o coverage_reports/ coverage_reports/app.info

    I hope this can be of help to someone.

提交回复
热议问题