rsvs3D  0.0.0
Codes for the c++ implementation of the 3D RSVS
test.hpp
Go to the documentation of this file.
1 
6 //===============================================
7 // Include Guards
8 #ifndef TEST_H_INCLUDED
9 #define TEST_H_INCLUDED
10 
11 //===============================================
12 // Levels of debuging Guards
13 #ifdef DEBUGLVL2 // All Debugging calls
14 #define DEBUGLVL1
15 #define TEST_ALL
16 #endif
17 
18 #ifdef DEBUGLVL1 // Debugging of new features.
19 
20 #endif
21 
22 //=================================
23 // forward declared dependencies
24 // class foo; //when you only need a pointer not the actual object
25 // and to avoid circular dependencies
26 
27 //=================================
28 // included dependencies
29 #include <stdarg.h>
30 
31 #include <ctime>
32 #include <fstream>
33 #include <iostream>
34 #include <string>
35 
36 //==================================
37 // Code
38 // NOTE: function in a class definition are IMPLICITELY INLINED
39 // ie replaced by their code at compile time
40 
44 namespace rsvstest
45 {
46 
51 {
52  private:
53  int testCount;
54  int errFlag;
55  int errCount;
56  int unhandledError;
57  int prevTime;
58  int runTotal;
59  int lastRunTime;
60  std::string testName;
61 
62  public:
63  customtest(const char *testNameIn = "")
64  {
65  testCount = 0;
66  errFlag = 0;
67  errCount = 0;
68  unhandledError = 0;
69  runTotal = 0;
70  lastRunTime = 0;
71  testName = testNameIn;
72  std::cout << "-------------------------------------------------------------"
73  "---------------------------"
74  << std::endl;
75  std::cout << "-------------------------------------------------------------"
76  "---------------------------"
77  << std::endl;
78  std::cout << " Start testing " << testName << std::endl;
79  std::cout << "-------------------------------------------------------------"
80  "---------------------------"
81  << std::endl;
82  }
83  int ReturnErrCount()
84  {
85  return errCount;
86  }
87  ~customtest()
88  {
89  this->PrintSummary();
90  }
91 
92  int Run(std::function<int()> test, const char *funcName, int expectedTime = -1);
93  int RunSilent(std::function<int()> test, const char *funcName, int expectedTime = -1);
94  void PrintSummary();
95 };
96 
97 int maintest();
98 int shorttest();
99 int newtest();
100 int failingtest();
101 int arraystructtemplates();
102 int meshprocesses();
103 int snakeprocesses();
104 int longevolution();
105 int RSVSprocesses();
106 int RSVS2Dprocesses();
107 int tetgenprocesses();
108 int JSONprocesses();
109 int integrationprocesses();
110 int polyscopeprocesses();
111 } // namespace rsvstest
112 
113 // member function definition template <class T>
114 
115 #endif // POSTPROCESSING_H_INCLUDED
Class for customtest.
Definition: test.hpp:51
int RunSilent(std::function< int()> test, const char *funcName, int expectedTime=-1)
Runs a test function silently except if it returns an error.
Definition: test.cpp:281
Namespace for rsvs tests.
Definition: test.hpp:45