forked from EbenZhang/kcppunitlite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestresult.h
More file actions
37 lines (29 loc) · 881 Bytes
/
testresult.h
File metadata and controls
37 lines (29 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef TESTRESULT_H
#define TESTRESULT_H
// TestResult is a simple little class which accepts notifications from
// tests. In its current form, it takes these notifications and prints
// them on the standard output.
//
// If you need different behavior, you can alter it in place or subclass
// TestResult to provide it. The TestResult hierarchy can be as simple
// or complex as you require to support your application.
#include <vector>
#include "failure.h"
class TestResult
{
public:
TestResult () : testCount(0) {}
virtual ~TestResult(){}
void testWasRun ();
void startTests ();
void addFailure (Failure failure);
virtual void endTests ();
bool wasSucessful()const;
void addSuccess(const Success& success );
protected:
int testCount;
std::vector<Failure> failures;
std::vector<Success> successes;
};
#endif
//END OF FILE