CppTest  Version 2.0.0
cpptest-output.h
Go to the documentation of this file.
1 // ---
2 //
3 // $Id: cpptest-output.h,v 1.7 2008/07/15 21:20:26 hartwork Exp $
4 //
5 // CppTest - A C++ Unit Testing Framework
6 // Copyright (c) 2003 Niklas Lundell
7 //
8 // ---
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the
22 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 // Boston, MA 02111-1307, USA.
24 //
25 // ---
26 
29 #ifndef CPPTEST_OUTPUT_H
30 #define CPPTEST_OUTPUT_H
31 
32 #include <string>
33 
34 #ifdef _MSC_VER
35 # define CPPTEST_UNUSED(x)
36 #else
37 # define CPPTEST_UNUSED(x) (void)x
38 #endif
39 
40 namespace Test
41 {
42  class Source;
43  class Time;
44 
55  class Output
56  {
57  public:
60  virtual ~Output() {}
61 
66  virtual void initialize(int tests)
67  {
68  CPPTEST_UNUSED(tests);
69  }
70 
76  virtual void finished(int tests, const Time& time)
77  {
78  CPPTEST_UNUSED(tests);
79  CPPTEST_UNUSED(time);
80  }
81 
87  virtual void suite_start(int tests, const std::string& name)
88  {
89  CPPTEST_UNUSED(tests);
90  CPPTEST_UNUSED(name);
91  }
92 
99  virtual void suite_end(int tests, const std::string& name,
100  const Time& time)
101  {
102  CPPTEST_UNUSED(tests);
103  CPPTEST_UNUSED(name);
104  CPPTEST_UNUSED(time);
105  }
106 
111  virtual void test_start(const std::string& name)
112  {
113  CPPTEST_UNUSED(name);
114  }
115 
123  virtual void test_end(const std::string& name, bool ok,
124  const Time& time)
125  {
126  CPPTEST_UNUSED(name);
127  CPPTEST_UNUSED(ok);
128  CPPTEST_UNUSED(time);
129  }
130 
135  virtual void assertment(const Source& s)
136  {
137  CPPTEST_UNUSED(s);
138  }
139 
140  protected:
143  Output() {}
144 
145  private:
146  Output(const Output&);
147  Output& operator=(const Output&);
148  };
149 
150 } // namespace Test
151 
152 #endif // #ifndef CPPTEST_OUTPUT_H
virtual void initialize(int tests)
Definition: cpptest-output.h:66
virtual void assertment(const Source &s)
Definition: cpptest-output.h:135
virtual void test_end(const std::string &name, bool ok, const Time &time)
Definition: cpptest-output.h:123
Time representation.
Definition: cpptest-time.h:43
Assertment source information.
Definition: cpptest-source.h:42
virtual void suite_end(int tests, const std::string &name, const Time &time)
Definition: cpptest-output.h:99
virtual void suite_start(int tests, const std::string &name)
Definition: cpptest-output.h:87
virtual void finished(int tests, const Time &time)
Definition: cpptest-output.h:76
Definition: collectoroutput.cpp:37
virtual ~Output()
Definition: cpptest-output.h:60
Test suite output handler.
Definition: cpptest-output.h:55
Output()
Definition: cpptest-output.h:143
virtual void test_start(const std::string &name)
Definition: cpptest-output.h:111