CppUnit project page | FAQ | CppUnit home page |
Compounds | |
struct | CppUnitTestPlugIn |
Test plug-in interface. More... | |
class | TestPlugInDefaultImpl |
Default implementation of test plug-in interface. More... | |
Defines | |
#define | CPPUNIT_PLUGIN_EXPORT extern "C" |
A macro to export a function from a dynamic library. |
#include <cppunit/include/plugin/TestPlugIn.h>
CPPUNIT_PLUGIN_IMPLEMENT();
The interface CppUnitTestPlugIn is automatically implemented by the previous macro. You can define your one implementation.
To provide your custom implementation of the plug-in interface, you must:
Creating your own test plug-in with VC++:
#include <cppunit/plugin/TestPlugIn.h> CPPUNIT_PLUGIN_IMPLEMENT();
Notes to VC++ users:
When CppUnit is linked as a DLL, the singleton used for the TestFactoryRegistry is the same for the plug-in runner (also linked against CppUnit DLL). This means that the tests registered with the macros (at static initialization) are registered in the same registry. As soon as a DLL is loaded by the PlugInManager, the DLL static variable are constructed and the test registered to the TestFactoryRegistry.
After loading the DLL, the PlugInManager look-up a specific function exported by the DLL. That function returns a pointer on the plug-in interface, which is later used by the PlugInManager.
|
A macro to export a function from a dynamic library. This macro export the C function following it from a dynamic library. Exporting the function makes it accessible to the DynamicLibraryManager. Example of usage: #include <cppunit/include/plugin/TestPlugIn.h> CPPUNIT_PLUGIN_EXPORT CppUnitTestPlugIn *CPPUNIT_PLUGIN_EXPORTED_NAME(void) { ... return &myPlugInInterface; } |
hosts this site. |
Send comments to: CppUnit Developers |