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++ > Test
chooseGoogle Test
and create the project with the nameSampleFlowsTest
. -
While creating the project add
SampleFlow
as one of the references to the test project. -
Then go to the Project Properties for
SampleFlowTest
project 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++ Directories
add the pathC:\Program Files\Rhino 6 SDK\inc
inInclude Directories
andC:\Program Files\Rhino 6 SDK\lib\Release
inLibrary Directories
. - In
Project Properties > Configuration Properties > C/C++ > Preprocessor
add the following to thePreprocessor Definitions
- In
Project Properties > Configuration Properties > C/C++ > Language
setC++ Language Standard : ISO C++ 14 Standard(/std:c++14)
. - In
Project Properties > Configuration Properties > Linker > Input
add 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.