How to Configure GoogleMock in Visual Studio 2017 After Already Installing GoogleTest?

前端 未结 3 1125
不思量自难忘°
不思量自难忘° 2021-01-18 00:05

I installed the Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn package into my VS 2017 application solution. This was accomplished by adding a new GoogleTest pr

3条回答
  •  春和景丽
    2021-01-18 00:31

    There are some bad Google Test / Google Mock packages available on NuGet, such as the one referenced by this question. The one you want is the gmock package authored by Google Inc (version v1.8.1 as of this writing).

    Once this package has been installed, your project's packages.config should look like:

    
    
      
    
    

    And you can begin using GMock simply by adding

    #include "gmock\gmock.h"
    

    as mentioned in the documentation.

提交回复
热议问题