CppUnit project page
FAQ
CppUnit home page
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
include
cppunit
TestResult.h
Go to the documentation of this file.
1
#ifndef CPPUNIT_TESTRESULT_H
2
#define CPPUNIT_TESTRESULT_H
3
4
#include <
cppunit/Portability.h
>
5
6
#if CPPUNIT_NEED_DLL_DECL
7
#pragma warning( push )
8
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
9
#endif
10
11
#include <
cppunit/SynchronizedObject.h
>
12
#include <
cppunit/portability/CppUnitDeque.h
>
13
14
CPPUNIT_NS_BEGIN
15
16
17
class
Exception
;
18
class
Functor
;
19
class
Protector
;
20
class
ProtectorChain
;
21
class
Test
;
22
class
TestFailure
;
23
class
TestListener
;
24
25
26
#if CPPUNIT_NEED_DLL_DECL
27
// template class CPPUNIT_API std::deque<TestListener *>;
28
#endif
29
50
class
CPPUNIT_API
TestResult
:
protected
SynchronizedObject
51
{
52
public
:
54
TestResult
(
SynchronizationObject
*syncObject = 0 );
55
57
virtual
~
TestResult
();
58
59
virtual
void
addListener(
TestListener
*listener );
60
61
virtual
void
removeListener(
TestListener
*listener );
62
64
virtual
void
reset();
65
67
virtual
void
stop();
68
70
virtual
bool
shouldStop()
const
;
71
73
virtual
void
startTest(
Test
*test );
74
79
virtual
void
addError(
Test
*test,
Exception
*e );
80
84
virtual
void
addFailure(
Test
*test,
Exception
*e );
85
87
virtual
void
endTest(
Test
*test );
88
90
virtual
void
startSuite(
Test
*test );
91
93
virtual
void
endSuite(
Test
*test );
94
99
virtual
void
runTest(
Test
*test );
100
116
virtual
bool
protect(
const
Functor
&functor,
117
Test
*test,
118
const
std::string &shortDescription = std::string(
""
) );
119
121
virtual
void
pushProtector(
Protector
*protector );
122
124
virtual
void
popProtector();
125
126
protected
:
129
void
addFailure(
const
TestFailure
&failure );
130
131
virtual
void
startTestRun(
Test
*test );
132
virtual
void
endTestRun(
Test
*test );
133
134
protected
:
135
typedef
CppUnitDeque<TestListener *>
TestListeners
;
136
TestListeners
m_listeners
;
137
ProtectorChain
*
m_protectorChain
;
138
bool
m_stop
;
139
140
private
:
141
TestResult
(
const
TestResult
&other );
142
TestResult
&
operator =
(
const
TestResult
&other );
143
};
144
145
146
CPPUNIT_NS_END
147
148
149
#if CPPUNIT_NEED_DLL_DECL
150
#pragma warning( pop )
151
#endif
152
153
#endif // CPPUNIT_TESTRESULT_H
154
155
hosts this site.
Send comments to:
CppUnit Developers