-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest_driver.h
More file actions
50 lines (37 loc) · 1.33 KB
/
test_driver.h
File metadata and controls
50 lines (37 loc) · 1.33 KB
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
// -*- C++ -*-
/* This file declares TestDriver, a base class for various test driver
objects. */
#ifndef _TEST_DRIVER_H_
#define _TEST_DRIVER_H_
#include "minirel.h"
//extern "C" int unlink( const char* );
class TestDriver
{
public:
// This runs a series of tests. If it returns OK, then everything worked
// as advertised. Otherwise, there were errors reported.
virtual Status runTests();
protected:
// This constructs the tester. You supply a name like "dbtest" as the
// root of the database and log file names.
TestDriver( const char* nameRoot );
virtual ~TestDriver();
char* dbpath;
char* logpath;
// Subclasses override these tests.
virtual int test1();
virtual int test2();
virtual int test3();
virtual int test4();
virtual int test5();
virtual int test6();
// ...and this method, which is printed as the kind of test being done,
// for example "Disk Space Management".
virtual const char* testName();
void testFailure( Status& status, Status expectedStatus,
const char* activity, int postedErrExpected = TRUE );
typedef int (TestDriver::*testFunction)();
virtual void runTest( Status& status, testFunction test );
virtual Status runAllTests();
};
#endif