Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

/home/tommi/cxxtools/include/cxxtools/unit/application.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005-2008 by Dr. Marc Boris Duerner                     *
00003  *                                                                         *
00004  *   This program is free software; you can redistribute it and/or modify  *
00005  *   it under the terms of the GNU Library General Public License as       *
00006  *   published by the Free Software Foundation; either version 2 of the    *
00007  *   License, or (at your option) any later version.                       *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU Library General Public     *
00015  *   License along with this program; if not, write to the                 *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00018  ***************************************************************************/
00019 #ifndef CXXTOOLS_UNIT_APPLICATION_H
00020 #define CXXTOOLS_UNIT_APPLICATION_H
00021 
00022 #include <cxxtools/unit/api.h>
00023 #include <cxxtools/unit/reporter.h>
00024 #include <cxxtools/unit/test.h>
00025 #include <sstream>
00026 
00027 namespace cxxtools {
00028 
00029 namespace unit {
00030 
00053     class CXXTOOLS_UNIT_API Application : public Test
00054     {
00055         public:
00058             Application();
00059 
00062             virtual ~Application();
00063 
00064             static Application& instance();
00065 
00070             Test* findTest(const std::string& testname);
00071 
00076             void attachReporter(Reporter& r);
00077 
00083             void attachReporter(Reporter& r, const std::string& testname);
00084 
00092             void run(const std::string& testName);
00093 
00100             virtual void run();
00101 
00103             unsigned errors() const
00104             { return _errors; }
00105 
00110             static std::list<Test*>& tests();
00111 
00119             void registerTest(Test& test);
00120 
00121             void deregisterTest(Test& test);
00122 
00123         private:
00124             static Application* _app;
00125 
00128             unsigned _errors;
00129     };
00130 
00131 } // namespace unit
00132 
00133 } // namespace cxxtools
00134 
00135 #endif
Copyright © 2008 The Tntnet Development Team
Tntnet 1.6