-
Notifications
You must be signed in to change notification settings - Fork 0
/
suite.h
50 lines (45 loc) · 1010 Bytes
/
suite.h
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
// suite.h
#ifndef SUITE_H
#define SUITE_H
#include "../TestSuite/Test.h"
#include <vector>
using std::vector;
class TestSuiteError;
class Suite {
public:
Suite(const string& name, ostream* osptr = &cout);
string getName() const;
long getNumPassed() const;
long getNumFailed() const;
const ostream* getStream() const;
void setStream(ostream* osptr);
void addTest(Test* t) throw (TestSuiteError);
void addSuite(const Suite&)
throw(TestSuiteError);
void run(); // Calls Test::run() repeatedly
long report() const;
void free(); // Deletes tests
private:
string name;
ostream* osptr;
vector<Test*> tests;
void reset();
// Disallowed ops:
Suite(const Suite&);
Suite& operator=(const Suite&);
};
inline
Suite::Suite(const string& name, ostream* osptr)
: name(name) {
this->osptr = osptr;
}
inline string Suite::getName() const {
return name;
}
inline const ostream* Suite::getStream() const {
return osptr;
}
inline void Suite::setStream(ostream* osptr) {
this->osptr = osptr;
}
#endif