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

tdeunittest

modrunner.cpp
00001 /*
00002  * Copyright (C)  2005  Jeroen Wijnhout <Jeroen.Wijnhout@kdemail.net>
00003  *
00004  * Redistribution and use in source and binary forms, with or without
00005  * modification, are permitted provided that the following conditions
00006  * are met:
00007  *
00008  * 1. Redistributions of source code must retain the above copyright
00009  *   notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *   notice, this list of conditions and the following disclaimer in the
00012  *   documentation and/or other materials provided with the distribution.
00013  *
00014  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00015  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00016  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00017  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00018  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00019  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00020  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00021  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00022  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00023  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00024  */
00025 
00026 #include <kdebug.h>
00027 #include <tdeglobal.h>
00028 #include <kinstance.h>
00029 #include <tdeaboutdata.h>
00030 #include <tdecmdlineargs.h>
00031 #include <tdelocale.h>
00032 
00033 #include "runner.h"
00034 
00035 static const char description[] =
00036     I18N_NOOP("A command-line application that can be used to run KUnitTest modules.");
00037 
00038 static const char version[] = "0.1";
00039 
00040 static TDECmdLineOptions options[] =
00041 {
00042     {"query [regexp]", I18N_NOOP("Only run modules whose filenames match the regexp."), "^tdeunittest_.*\\.la$"},
00043     {"folder [folder]", I18N_NOOP("Only run tests modules which are found in the folder. Use the query option to select modules."), "."},
00044     { "enable-dbgcap", I18N_NOOP("Disables debug capturing. You typically use this option when you use the GUI."), 0},
00045     TDECmdLineLastOption
00046 };
00047 
00048 
00049 int main( int argc, char **argv )
00050 {    
00051     TDEInstance instance("modrunner");
00052 
00053     TDEAboutData about("KUnitTest Module Runner", I18N_NOOP("KUnitTest ModRunner"), version, description,
00054                      TDEAboutData::License_BSD, "(C) 2005 Jeroen Wijnhout", 0, 0,
00055                      "Jeroen.Wijnhout@kdemail.net");
00056 
00057     TDECmdLineArgs::init(argc, argv, &about);
00058     TDECmdLineArgs::addCmdLineOptions( options );
00059     TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
00060 
00061     KUnitTest::Runner::loadModules(args->getOption("folder"), args->getOption("query"));
00062     KUnitTest::Runner::setDebugCapturingEnabled(args->isSet("enable-dbgcap"));
00063 
00064     KUnitTest::Runner::self()->runTests();
00065 
00066     return KUnitTest::Runner::self()->numberOfFailedTests() - KUnitTest::Runner::self()->numberOfExpectedFailures();
00067 }

tdeunittest

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

tdeunittest

Skip menu "tdeunittest"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeunittest by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.