In this document we describe how to setup test for Rhino 6 plugins using Google Test. The tests are created as a separate project and not as Rhino 6 plugin project with the advantage that the Rhino application is not started while testing which makes for streamlined testing environment.
-
From the Flows solution in Visual Studio 2017 go to
Add > New Project. FromVisual C++ > TestchooseGoogle Testand create the project with the nameSampleFlowsTest. -
While creating the project add
SampleFlowas one of the references to the test project. -
Then go to the Project Properties for
SampleFlowTestproject and make sure the following property variables are set.- In
Project Properties > Configuration Properties > General,Project Defaults > Configuration Type > Application(exe). - In
Project Properties > Configuration Properties > VC++ Directoriesadd the pathC:\Program Files\Rhino 6 SDK\incinInclude DirectoriesandC:\Program Files\Rhino 6 SDK\lib\ReleaseinLibrary Directories. - In
Project Properties > Configuration Properties > C/C++ > Preprocessoradd the following to thePreprocessor Definitions
- In
Project Properties > Configuration Properties > C/C++ > LanguagesetC++ Language Standard : ISO C++ 14 Standard(/std:c++14). - In
Project Properties > Configuration Properties > Linker > Inputadd the following additional dependencies:
- In
-
Then we add the targetver.h and add necessary changes to pch.h so as to make the test project Rhino 6 ready.
The SampleFlowTest project should now compile successfully.