-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_main.cpp
More file actions
45 lines (34 loc) · 820 Bytes
/
test_main.cpp
File metadata and controls
45 lines (34 loc) · 820 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
#include <iostream>
#include "DerivedTests.hpp"
#define VERBOSE 0
using std::cout;
using std::cerr;
using std::endl;
int main()
{
Test *m[] = { new DBMSTest, new ExceptionsDBMSTest, new ScannerTest,
new ParserTest, NULL };
// Test *m[] = { new ParserTest, NULL };
// Test *m[] = { new ScannerTest, NULL };
Test **p = m;
while (*p != NULL) {
(*p)->setup();
try {
(*p)->execute(VERBOSE);
} catch (...) {
cerr << "Something wrong" << endl;
(*p)->teardown();
break;
}
(*p)->teardown();
++p;
if (VERBOSE) cout << endl;
cout << "Passed" << endl;
if (VERBOSE) cout << endl;
}
p = m;
while (*p != NULL) {
delete *p;
++p;
}
}