Experience in using gcov and lcov in mingw and cygwin Environments

Source: Internet
Author: User
Tags gcov perl script

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.