• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kunittest
 

kunittest

Namespaces | Defines
module.h File Reference
#include <tqstring.h>
#include <klibloader.h>
#include <kunittest/runner.h>

Go to the source code of this file.

Namespaces

namespace  KUnitTest

Defines

#define KUNITTEST_MODULE(library, suite)
#define KUNITTEST_MODULE_REGISTER_TESTER(tester)
#define KUNITTEST_MODULE_REGISTER_NAMEDTESTER(name, tester)

Detailed Description

Provides macros to ease building unit tests as shared libraries

Definition in file module.h.


Define Documentation

#define KUNITTEST_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.

 KUNITTEST_MODULE(kunittest_samplemodule,"TestSuite") 

Definition at line 50 of file module.h.

#define KUNITTEST_MODULE_REGISTER_NAMEDTESTER (   name,
  tester 
)
Value:
static class tester##ModuleAutoregister                                                   \
    {                                                                                         \
    public:                                                                                   \
        tester##ModuleAutoregister()                                                          \
        {                                                                                     \
            TQString fullName = s_kunittest_suite + TQString("::") + TQString::fromLocal8Bit(name); \
            KUnitTest::Tester *test = new tester(fullName.local8Bit());                       \
            kunittest_registerModuleTester(fullName.local8Bit(), test);                       \
        }                                                                                     \
    } tester##ModuleAutoregisterInstance;

Use this macro to add a tester class, with specified name, to your module..

 KUNITTEST_MODULE_REGISTER_TESTER("SubSuite::PrettyName",SimpleSampleTester) 

Definition at line 107 of file module.h.

#define KUNITTEST_MODULE_REGISTER_TESTER (   tester)
Value:
static class tester##ModuleAutoregister                                                     \
    {                                                                                           \
    public:                                                                                     \
        tester##ModuleAutoregister()                                                            \
        {                                                                                       \
            KUnitTest::Tester *test = new tester();                                             \
            TQString name = s_kunittest_suite + TQString::fromLatin1("::") + TQString::fromLocal8Bit(#tester); \
            test->setName(name.local8Bit());                                                    \
            kunittest_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.

 KUNITTEST_MODULE_REGISTER_TESTER(SimpleSampleTester) 

Definition at line 89 of file module.h.

kunittest

Skip menu "kunittest"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kunittest

Skip menu "kunittest"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kunittest by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |