[Cppunit-devel] Test Plug In Technology
Brought to you by:
blep
From: Baptiste L. <bl...@cl...> - 2001-06-28 19:54:04
|
Some of you might have noticed, yesterday I committed a new feature for the VC++ Platform. * What it is ? It is a test runner (named test plug in runner) that can load and run test contains in a DLL that implement a specific interface. The nifty thing is the test runner can reload the DLL. A feature that is to be implemented is that the reload and test run would be automatic: if the DLL is modified then it is reloaded and the test are run. The name test plug in came from the fact that the technic use there is similar to the one used when writing plug-ins (at least, I believe so). * How do I use it ? Your DLL must be a standard WIN32 DLL, not an MFC extension (I don't know if it is possible to load/unload them like I'm doing for the plug-in). It must be linked against the same Run-time as the test plug in runner (still those memory allocation/deallocation problem). Finally, the DLL must export a function that is defined as follow: extern "C" { TESTPLUGIN_API TestPlugInInterface *GetTestPlugInInterface(); } TESTPLUGIN_API is a symbol created by VC++ Wizard, that expand to "__declspec(dllexport)" when you are building the DLL. The TestPlugInInterface class is defined in include/msvc6/testrunner/TestPlugInInterface.h. You must subclass that class in your DLL and implement the only virtual method it has: CppUnit::Test *makeTest(); You guessed it, that method must return the test that will be used by the test runner. The example examples\msvc6\TestPlugIn\ demonstrate how to create a test plug-in. The test plug in runner is in src\msvc6\testpluginrunner. It still need work (being able to save the configuration, managing multiple configurations, and the automatic reload & run feature). Ideas & comments are welcome, Baptiste. --- Baptiste Lepilleur <gai...@fr...> http://gaiacrtn.free.fr/index.html Author of The Text Reformatter, a tool for fanfiction readers and writers. Language: English, French (Well, I'm French). |