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?
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.
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.