Copy link to clipboard
Copied
Hi C++ plug-in developers!
I've tried to implement a unit test for my plug-in using GoogleTest.
To build the plug-in I'm using CMake and to add the testing framework I've added a subfolder to my plug-in project and downloaded it with FetchContent (see https://google.github.io/googletest/quickstart-cmake.html)
This works nicely for my own code.
But when I try to test code with Adobe's header files included I get an unknown type error. So I included the same directories and precompiled headers to my test executable as I ded for my plug-in target. This way I got rid of the unknown type errors but ended up with:
undefined symbols for architecture x86_64:
"K2Memory::RTLCompatibleNewDelegate(unsigned long)", referenced from:
testing::internal::TypedExpectation<int (bool, double)>& testing::internal::TypedExpectation<int (bool, double)>::WillOnce<void>(testing::Action<int (bool, double)>) in Test.o
...
"K2Memory::RTLCompatibleDeleteDelegate(void*)", referenced from:
Dummy_foobar_Test::~Dummy_foobar_Test() in Test.o
TeaBreakTest_MorningTea_Test::~TeaBreakTest_MorningTea_Test() in Test.o
...
Has anybody managed to implement a unit test with GoogleTest including an Adobe header like WideString.h or PMString.h? Is it possible at all?
There's an entry for the second error message in this forum (see https://community.adobe.com/t5/indesign-discussions/trackallocation-asserts-why-how-to-get-rid-of-it...) saying that the RTLCompatibleDeleteDelegate error means that the delete operator is not properly overloaded and/or that an Adobe SDK library is missing. I haven't found out which library I might have missed.
I hope someone can help me, best regards
Lars
I've been working in the background to get you an answer.
One option is to use the Dev Support. It's not a free service unfortunately.
If you do get to use this service do let us know how you are getting on and keep in touch.
https://helpx.adobe.com/support/programs/cc-exchange-developer-support.html
Thanks
Copy link to clipboard
Copied
Hi @lbergerVJ,
This seems more of a C++ issue than an Adobe SDK issue. The thing is not a lot of us on this forum dab in SDK development so getting reponse on this one would be largely in vain. I suggest you try posting on Stackoverflow as well. There atleast you would get ideas to try.
-Manan
Copy link to clipboard
Copied
I've been working in the background to get you an answer.
One option is to use the Dev Support. It's not a free service unfortunately.
If you do get to use this service do let us know how you are getting on and keep in touch.
https://helpx.adobe.com/support/programs/cc-exchange-developer-support.html
Thanks
Copy link to clipboard
Copied
InDesign plug-ins rely on a ton of shared libraries that are part of the InDesign application. PMRuntimeLib, ObjectModelLib, PublicLib etc.
Of course adding these libraries to a standalone project does not solve the real problem. If you intend to run your plug-in without InDesign, you'd have to mock decades worth of code to get similar behaviour.
A realistic approach would be to turn your testing framework into another plug-in (maybe start from snippetrunner), add some UI or scripting support and let everything run from within InDesign.