The googleTest environment set up as follow:
Download the googleTest
The load path is https://github.com/google/googletest/tree/release-1.8.0
The file storage path is D:\Ford_SDK_Test\gtest\googletest-release-1.8.0
Ps. because the compile tool is VS2015, so the version of googletest is selected release-1.8.0.
Build the gtest.sln with Vs2015(debug/release)
The file path is D:\Ford_SDK_Test\gtest\googletest-release-1.8.0\googletest\msvc\gtest.sln.
The generated file is gtestd.lib
(its path is D:\Ford_SDK_Test\gtest\googletest-release-1.8.0\googletest\msvc\gtest\Debug
or D:\Ford_SDK_Test\gtest\googletest-release-1.8.0\googletest\msvc\gtest\Release)
- Create a project for test and configure the its properties
- Create the test project: gtest_example1
- Open the property pages
- VC++ Directories
- Include Directories
The include fold path of googlemock:
D:\Ford_SDK_Test\gtest\googletest-release-1.8.0\googlemock\include\gmock
The include fold path of googletes:
D:\Ford_SDK_Test\gtest\googletest-release-1.8.0\googletest\include\gtest
- Library Directories
The gtest.lib path:
D:\Ford_SDK_Test\gtest\googletest-release-1.8.0\googletest\msvc\gtest\Debug
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLiAzNfRHLGZkRGZkRfJ3bs92YsYTMfVmepNHL90ERNNTQqJGaK5mYwh2MMBjVtJWd0ckW65UbM5WOHJWa5kHT20ESjBjUIF2X0hXZ0xCMx81dvRWYoNHLrdEZwZ1Rh5WNXp1bwNjW1ZUba9VZwlHdssmch1mclRXY39CXldWYtlWPzNXZj9mcw1ycz9WL49zZuBnL5UjMyIjNzETM3EjNwkTMwIzLc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
- C/C++ -> Code Generation
Runtime Library : Multi-threaded Debug(/MTd)
- Linker -> Input
Additional Dependencies:
- The gtest.lib path:
D:\Ford_SDK_Test\gtest\googletest-release-1.8.0\googletest\msvc\gtest\Debug
- The structure of Program
Test condition A:
The test result:
Test condition B:
The test result: