Eclipse C++,cygwin 64,gcov,lcov Monomer & Coverage test environment build notes

Source: Internet
Author: User
Tags gcov

1. Download and install Eclipse IDE for C + + developers

Https://eclipse.org/downloads/packages/eclipse-ide-cc-developers/lunasr1

2. Download and install Cygwin

https://www.cygwin.com/

When installing select Package, remember to select all GCC-related

The boost is used in the test, so the boost is also loaded

The bags under the devel try to pack as much as possible.

3. Download and install the CDT Gcov plugin

http://sourceforge.jp/projects/ginkgo/
→http://sourceforge.jp/projects/ginkgo/releases/32486

Download the latest version and copy to Eclipse's plugin directory to restart eclipse

4. Deploy and install Google Test

https://code.google.com/p/googletest/
→https://code.google.com/p/googletest/downloads/list

Download the latest version, then refer to the following steps

Unzip the zip file in the appropriate directory and execute the following command under the extracted directory

(Cygwin environment)

> mkdir lib
> g++-c-iinclude-i. src/gtest-all.cc
> AR-RV lib/libgtest.a GTEST-ALL.O

Copy the Gtest directory under [Gtest-1.7.0/include] under the extracted directory to the%cygwin64%/usr/include directory

5. Import/New Project

Note that the option to create a new

Toolchain for Indexer Settings→cygwin GCC

6. Activating plugin

Project Properties

properties→c/c++ builder→c coverage→activate nature[Check)

properties→c/c++ builder→setting→toolsettings→cygwin C compiler→miscellaneous→other flags[Append-fprofile-arcs-ft Est-coverage]

Properties→setting→toolsettings→cygwin C linker→miscellaneous→linker flags[additional-fprofile-arcs-ftest-coverage]

Properties→setting→toolsettings→cygwin C linker→libraries→libraries [gtest] library[/cygdrive/c/cygwin64/lib]

* If the Toolsettings tab is not displayed, then the following settings are required

properties→c/c++ builder→builder settings→generate makefiles automatically[Check]

7. After executing the file, generate the. gcda. gcno file

Good reference documentation for Google test testing

Http://www.cnblogs.com/coderzh/archive/2009/04/06/1426755.html

Eclipse C++,cygwin 64,gcov,lcov Monomer & Coverage test environment build notes

Related Article

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.