GCOVR giving empty results zero percent in MAC

核能气质少年 提交于 2019-11-28 11:55:08

问题


I have the .gcda and .gcno files in a folder, from which I am running the below command.

$ gcovr -r .

and the result is as below if I run gcov on the gcda files I get the proper coverage value.


回答1:


After a tedious search in multiple forums and countless experiments, finally I figured out the issue and resolved it.

Two things are important to get the proper output from gcovr. One is from where the gcovr is executed and other is the root directory path.

gcovr should be executed from the folder where the .gcda and .gcno files exist. And the root path is the folder where the source files(.c or .cpp) exist.

With this, the command looks like something as shown below.

rr-mac:gcdaFolder$ gcovr -r /path_to_C_sourceFiles/ .

For output html file below command works

rr-mac:gcdaFolder$ gcovr --html -o Filename_rp.html -r /path_to_C_sourceFiles/ .

Note: The dot(.) at the end is mandatory

Hope this is helpful for those who are struck with this type of issue.



来源:https://stackoverflow.com/questions/38875615/gcovr-giving-empty-results-zero-percent-in-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!