Testing Rhino plugin with Google Test

visualstudio
plugin
testing

#1

I’m unsuccesfully trying to set a blank Rhino plugin with Google Test.
Things I tried:

  • Create a c++ plugin using the wizard for VS
  • Added a project using the Google Test wizard
  • Added the source folder of the plugin into the include paths of the Google Test project
  • Added the .rhp file in the “additional dependencies” paths of the Google Test project

After these steps I’m getting LNK1107 invalid or damaged file.
I tried also to change the extension to .lib and change to static library.
This gives me LNK1104 can’t open ‘mfc100ud.lib’ and LNK2038 different _MSC_VER ‘1600’ differs from ‘1900’

I don’t really know how to proceed. Any suggestion or resource?

Thank you,
Gerard


(Dale Fugier) #2

Hi @Gerard2,

I don’t believe anyone here has any experience with Google Test. Where can we learn more about it?

– Dale


#3

It’s basically a c++ testing framework. Recently, a plugin for visual studio was developed for testing integration with google test.

I kept trying to figure out how to make it work with a plugin. Since plugins (.rhp) need the Rhino environment to work, I suppose the only way would be creating a plugin and run the tests inside Rhino, and then capturing the standard output somehow


(Dale Fugier) #4

Have you tried Visual Studio’s Unit Testing?

https://blogs.msdn.microsoft.com/vcblog/2017/04/19/cpp-testing-in-visual-studio/

– Dale


#5

Is it possible to configure VS Unit Testing with a Rhino plugin? It looks to me like I would have the same problems for running the tests (we would have to run the tests from inside Rhino with a test plugin)


#6

Hi,

I was trying to achieve this some time ago and the conclusion I arrived was to create a test plugin as you say @Gerard2 and then execute “testing” commands with Rhino launched. I would like to use googletest or visual studio tests (or any other) to check my methods before packing the software in a more intuitive way.

Regards,


#7

Yes, something with VS integration would be great, Rhino is quite heavy for testing. If I’m not misunderstood Rhino 6 will be packed in a dll so we can do more stuff like this.

Thanks


#10

Take a look at this: https://discourse.mcneel.com/t/unit-testing-plugin-code/39830/11 is something similar to what we were talking but using NUnit, thanks @Andrew_Zukoski for sharing.

Regards,