forked from cloudius-systems/osv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtst-hub.hh
40 lines (31 loc) · 812 Bytes
/
tst-hub.hh
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
/*
* Copyright (C) 2013 Cloudius Systems, Ltd.
*
* This work is open source software, licensed under the terms of the
* BSD license as described in the LICENSE file in the top-level directory.
*/
#ifndef __UNIT_TESTS__
#define __UNIT_TESTS__
#include <list>
namespace unit_tests {
class vtest {
public:
virtual void run() = 0;
};
class tests {
public:
static tests& instance() {
static tests i;
return i;
};
void register_test(vtest* t) {tl.push_back(t);};
void run() {for (auto i=tl.begin();i != tl.end();i++) (*i)->run();};
static void execute_tests();
private:
tests() {};
tests(tests const &t);
void operator=(tests const &t);
std::list<vtest*> tl;
};
};
#endif