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