• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KUnitTest

modrunner.cpp

Go to the documentation of this file.
00001 
00026 #include <kdebug.h>
00027 #include <kglobal.h>
00028 #include <kcomponentdata.h>
00029 #include <kaboutdata.h>
00030 #include <kcmdlineargs.h>
00031 #include <klocale.h>
00032 
00033 #include "runner.h"
00034 
00035 
00036 int main( int argc, char **argv )
00037 {    
00038     KComponentData componentData("modrunner");
00039 
00040     KLocalizedString description = 
00041         ki18n("A command-line application that can be used to run KUnitTest modules.");
00042 
00043     const char version[] = "0.1";
00044 
00045     KCmdLineOptions options;
00046     options.add("query [regexp]", ki18n("Only run modules whose filenames match the regexp."), "^kunittest_.*\\.la$");
00047     options.add("folder [folder]", ki18n("Only run tests modules which are found in the folder. Use the query option to select modules."), ".");
00048     options.add("enable-dbgcap", ki18n("Disables debug capturing. You typically use this option when you use the GUI."));
00049 
00050     KAboutData about("KUnitTest Module Runner", 0, ki18n("KUnitTest ModRunner"), version, description,
00051                      KAboutData::License_BSD, ki18n("(C) 2005 Jeroen Wijnhout"), KLocalizedString(), 0,
00052                      "Jeroen.Wijnhout@kdemail.net");
00053 
00054     KCmdLineArgs::init(argc, argv, &about);
00055     KCmdLineArgs::addCmdLineOptions( options );
00056     KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
00057 
00058     KUnitTest::Runner::loadModules(args->getOption("folder"), args->getOption("query"));
00059     KUnitTest::Runner::setDebugCapturingEnabled(args->isSet("enable-dbgcap"));
00060 
00061     KUnitTest::Runner::self()->runTests();
00062 
00063     return KUnitTest::Runner::self()->numberOfFailedTests() - KUnitTest::Runner::self()->numberOfExpectedFailures();
00064 }

KUnitTest

Skip menu "KUnitTest"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal