LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
TestApparatus.h
1 #ifndef RUNIT_TEST_APPARATUS_H_
2 #define RUNIT_TEST_APPARATUS_H_
3 
4 #include "Defines.h"
5 
6 #include <string>
7 #include <vector>
8 
9 #include "RUnit_Assert.h"
10 
11 #include "RUnit_Test.h"
12 
13 namespace RUnit
14 {
15 
16 class TestApparatus
17 {
18 public:
19  static const unsigned char OPT_QUIET;
20  static const unsigned char OPT_BASIC;
21  static const unsigned char OPT_VERBOSE;
22 
23  TestApparatus();
24 
25  void EnableOption(unsigned char option);
26  void DisableOption(unsigned char option);
27  bool OptionEnabled(unsigned char option);
28 
29  void RegisterTest(RU_FUNCPTR func, std::string testName);
30 
31  void operator()(RU_FUNCPTR func, std::string testName) // shorthand
32  {
33  RegisterTest(func, testName);
34  }
35 
36  void Run();
37 
38  void Reset();
39 
40 private:
41  unsigned char m_options;
42 
43  std::vector<Test> m_tests;
44  int m_failedCount;
45 };
46 
47 }
48 #endif