Address: http://blog.csdn.net/ariesjzj/article/details/7802872
1. cygwin has two compiler options under/bin: i686-pc-mingw32-gcc and i686-pc-cygwin-gcc. The default value is the former. The executable files compiled by cygwin can use gcov and lcov well. However, if the project is a mingw project, although it can be compiled using the mingw GCC, it cannot be compiled using gcov, even if the-fprofile-arcs-ftest-coverage is used to compile and use the-lgcov link, an error occurred while running. However, compiled in a pure mingw environment on windows can be used.
2. Note that it is best to use a relative path for the source file path during compilation. Otherwise, the Windows directory prefix of mingw will be added to the generated gcno file, and sometimes the code coverage report generation process will fail.
3. Another problem is that mingw does not have lcov, but lcov is a Perl script, which is easier to transplant. Copy the Linux lcov (including the five files lcov, gendesc, genhtml, geninfo, and genpng) to the bin directory of cygwin in windows.
4. If the Hang is occupied during lcov processing, you only need to delete it from geninfo.
Push (@ gcov_options, "-A") if ($ gcov_caps-> {'all-blocks '});
One row.