Menu

[r55]: / trunk / cppunit / include / cppunit / TestRegistry.h  Maximize  Restore  History

Download this file

43 lines (29 with data), 978 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
#ifndef CPPUNIT_TESTREGISTRY_H
#define CPPUNIT_TESTREGISTRY_H
#include <vector>
#include <string>
namespace CppUnit {
class Test;
/** This class is used to register tests and testcases.
*
* It implements a registry to place the test cases into.
* The test cases can then register themselves.
* All TestCallers and those TestCases that are constructed
* register themselve automatically.
*
*/
class TestRegistry {
public:
static TestRegistry& getRegistry();
~TestRegistry();
const std::vector<std::string>& getAllTestNames() const;
const std::vector<Test*>& getAllTests() const;
std::vector<Test*> getTest(const std::string& name) const;
void addTest(std::string name, Test* test);
private:
TestRegistry();
std::vector<std::string> m_registry_names;
std::vector<Test*> m_registry_tests;
};
} // namespace CppUnit
#endif // CPPUNIT_TESTREGISTRY_H
MongoDB Logo MongoDB