forked from EbenZhang/kcppunitlite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestresult.cpp
More file actions
54 lines (43 loc) · 884 Bytes
/
testresult.cpp
File metadata and controls
54 lines (43 loc) · 884 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "testresult.h"
#include "failure.h"
#include <iostream>
#ifdef _MSC_VER
#ifdef _DEBUG
#include "afx.h"
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
#endif
void TestResult::testWasRun()
{
testCount++;
}
void TestResult::startTests ()
{
}
void TestResult::addFailure (Failure failure)
{
using namespace std;
cout << failure << endl;
failures.push_back(failure);
}
void TestResult::endTests ()
{
using namespace std;
cout << testCount << " tests run" << endl;
int failureCount = failures.size();
if (failureCount > 0)
cout << "There were " << failureCount << " failures" << endl;
else
cout << "There were no test failures" << endl;
}
bool TestResult::wasSucessful()const
{
return failures.empty();
}
void TestResult::addSuccess( const Success& success )
{
successes.push_back(success);
}
//end of file