module.h File Reference
Go to the source code of this file.
Namespaces | |
KUnitTest | |
Macros | |
#define | TDEUNITTEST_MODULE(library, suite) |
#define | TDEUNITTEST_MODULE_REGISTER_TESTER(tester) |
#define | TDEUNITTEST_MODULE_REGISTER_NAMEDTESTER(name, tester) |
Detailed Description
Provides macros to ease building unit tests as shared libraries
Definition in file module.h.
Macro Definition Documentation
◆ TDEUNITTEST_MODULE
#define TDEUNITTEST_MODULE | ( | library, | |
suite | |||
) |
Use this macro if you are creating a KUnitTest module named library. This macro creates a module-class named a factory class. The module will appear under the name suite in the test runner. There is no need in calling the K_EXPORT_COMPONENT_FACTORY macro, this is taken care of automatically.
TDEUNITTEST_MODULE(tdeunittest_samplemodule,"TestSuite")
◆ TDEUNITTEST_MODULE_REGISTER_NAMEDTESTER
#define TDEUNITTEST_MODULE_REGISTER_NAMEDTESTER | ( | name, | |
tester | |||
) |
Value:
static class tester##ModuleAutoregister \
{ \
public: \
tester##ModuleAutoregister() \
{ \
TQString fullName = s_tdeunittest_suite + TQString("::") + TQString::fromLocal8Bit(name); \
KUnitTest::Tester *test = new tester(fullName.local8Bit()); \
tdeunittest_registerModuleTester(fullName.local8Bit(), test); \
} \
} tester##ModuleAutoregisterInstance;
Use this macro to add a tester class, with specified name, to your module..
TDEUNITTEST_MODULE_REGISTER_TESTER("SubSuite::PrettyName",SimpleSampleTester)
#define TDEUNITTEST_MODULE_REGISTER_TESTER(tester)
Definition: module.h:89
◆ TDEUNITTEST_MODULE_REGISTER_TESTER
#define TDEUNITTEST_MODULE_REGISTER_TESTER | ( | tester | ) |
Value:
static class tester##ModuleAutoregister \
{ \
public: \
tester##ModuleAutoregister() \
{ \
KUnitTest::Tester *test = new tester(); \
TQString name = s_tdeunittest_suite + TQString::fromLatin1("::") + TQString::fromLocal8Bit(#tester); \
test->setName(name.local8Bit()); \
tdeunittest_registerModuleTester(name.local8Bit(), test ); \
} \
} tester##ModuleAutoregisterInstance;
Use this macro to add a tester class to your module. The name of the tester will be identical to the class name.
TDEUNITTEST_MODULE_REGISTER_TESTER(SimpleSampleTester)