KUnitTest
Go to the documentation of this file.
26 #ifndef KUNITTEST_MODULE_H
27 #define KUNITTEST_MODULE_H
29 #include <QtCore/QString>
45 #define KUNITTEST_MODULE(library,suite) \
46 static const QString s_kunittest_suite = QLatin1String(suite); \
47 class library##Module : public QObject \
52 KUnitTest::Registry::const_iterator it = s_registry.constBegin(); \
53 for( ; it != s_registry.constEnd(); ++it ) \
54 KUnitTest::Runner::registerTester(it.key(), it.value()); \
57 static KUnitTest::Registry s_registry; \
60 KUnitTest::Registry library##Module::s_registry; \
62 void kunittest_registerModuleTester(const char *name, KUnitTest::Tester *test) \
64 library##Module::s_registry.insert(name, test); \
67 class module##Factory : public KLibFactory \
70 QObject *createObject (QObject *, const char *, const char *, const QStringList &) \
72 return new library##Module(); \
76 K_EXPORT_COMPONENT_FACTORY( library, module##Factory )
84 #define KUNITTEST_MODULE_REGISTER_TESTER( tester) \
85 static class tester##ModuleAutoregister \
88 tester##ModuleAutoregister() \
90 KUnitTest::Tester *test = new tester(); \
91 QString name = s_kunittest_suite + QLatin1String("::") + QString::fromLocal8Bit(#tester); \
92 test->setName(name.local8Bit()); \
93 kunittest_registerModuleTester(name.local8Bit(), test ); \
95 } tester##ModuleAutoregisterInstance;
102 #define KUNITTEST_MODULE_REGISTER_NAMEDTESTER( name , tester) \
103 static class tester##ModuleAutoregister \
106 tester##ModuleAutoregister() \
108 QString fullName = s_kunittest_suite + QString("::") + QString::fromLocal8Bit(name); \
109 KUnitTest::Tester *test = new tester(fullName.local8Bit()); \
110 kunittest_registerModuleTester(fullName.local8Bit(), test); \
112 } tester##ModuleAutoregisterInstance;
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:57 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.