blob: 94ff3ec50fcbd3d6d86f81d845774bdb0ab55f65 (
plain) (
blame)
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
51
52
53
54
55
|
#ifndef __meowpp_h__
#define __meowpp_h__
#include "meowpp/geo/Vector2D.h"
#include "meowpp/geo/Vector3D.h"
#include "meowpp/Usage.h"
#include "meowpp/oo/Register_Implement.h"
#include "meowpp/oo/Properties.h"
extern meow::Usage usg, usg2;
extern int count;
//////////////////////////////////
class TestFunctions: public meow::RegisterInterface<int>{
public:
TestFunctions(): RegisterInterface(){
usg2.addOption('t',
"Specify which part of the template to test",
"name", "",
false);
}
bool regImplement(meow::ImplementInterface<int>* imp,
std::string const& str){
usg2.addOptionValueAccept('t',
meow::stringPrintf("%d", imp->identify()),
str);
return RegisterInterface::regImplement(imp);
}
};
extern TestFunctions tests;
////////////////////////
class TestFunction: public meow::ImplementInterface<int>{
private:
std::string _name;
public:
TestFunction(std::string const& __name):
ImplementInterface(count++), _name("testing code about " + __name){
tests.regImplement(this, _name);
}
virtual ~TestFunction(){ }
virtual bool run() = 0;
std::string name() const{ return _name; }
};
////////////////////////
#define concat(a,b) a##b
#define TEST(a) \
class Test_##a: public TestFunction{ \
public: \
Test_##a(): TestFunction(#a){ } \
bool run();\
} __test_##a; bool Test_##a::run()
#endif // __meowpp_h__
|