CppTest home page CppTest project page

Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

cpptest-output.h

Go to the documentation of this file.
00001 // ---
00002 //
00003 // $Id: cpptest-output.h,v 1.7 2008/07/15 21:20:26 hartwork Exp $
00004 //
00005 // CppTest - A C++ Unit Testing Framework
00006 // Copyright (c) 2003 Niklas Lundell
00007 //
00008 // ---
00009 //
00010 // This library is free software; you can redistribute it and/or
00011 // modify it under the terms of the GNU Lesser General Public
00012 // License as published by the Free Software Foundation; either
00013 // version 2 of the License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the
00022 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00023 // Boston, MA 02111-1307, USA.
00024 //
00025 // ---
00026 
00029 #ifndef CPPTEST_OUTPUT_H
00030 #define CPPTEST_OUTPUT_H
00031 
00032 #include <string>
00033 
00034 #ifdef _MSC_VER
00035 # define CPPTEST_UNUSED(x)
00036 #else
00037 # define CPPTEST_UNUSED(x) (void)x
00038 #endif
00039 
00040 namespace Test
00041 {
00042     class Source;
00043     class Time;
00044     
00055     class Output
00056     {
00057     public:
00060         virtual ~Output() {}
00061         
00066         virtual void initialize(int tests)
00067         {
00068             CPPTEST_UNUSED(tests);
00069         }
00070         
00076         virtual void finished(int tests, const Time& time)
00077         {
00078             CPPTEST_UNUSED(tests);
00079             CPPTEST_UNUSED(time);
00080         }
00081 
00087         virtual void suite_start(int tests, const std::string& name)
00088         {
00089             CPPTEST_UNUSED(tests);
00090             CPPTEST_UNUSED(name);
00091         }
00092         
00099         virtual void suite_end(int tests, const std::string& name,
00100                                const Time& time)
00101         {
00102             CPPTEST_UNUSED(tests);
00103             CPPTEST_UNUSED(name);
00104             CPPTEST_UNUSED(time);
00105         }
00106         
00111         virtual void test_start(const std::string& name)
00112         {
00113             CPPTEST_UNUSED(name);
00114         }
00115         
00123         virtual void test_end(const std::string& name, bool ok,
00124                               const Time& time)
00125         {
00126             CPPTEST_UNUSED(name);
00127             CPPTEST_UNUSED(ok);
00128             CPPTEST_UNUSED(time);
00129         }
00130         
00135         virtual void assertment(const Source& s)
00136         {
00137             CPPTEST_UNUSED(s);
00138         }
00139 
00140     protected:
00143         Output() {}
00144         
00145     private:
00146         Output(const Output&);
00147         Output& operator=(const Output&);
00148     };
00149     
00150 } // namespace Test
00151     
00152 #endif // #ifndef CPPTEST_OUTPUT_H

Supported by:

SourceForge Logo