creation of tests.h
This commit is contained in:
28
headers/tests.h
Normal file
28
headers/tests.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef TESTS_H
|
||||
# define TESTS_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
# define TEST(s) \
|
||||
{\
|
||||
test_title = #s;\
|
||||
struct tester : public test_base {\
|
||||
void func()
|
||||
|
||||
# define TESTEND \
|
||||
};\
|
||||
test = new(tester);\
|
||||
test->title = test_title;\
|
||||
test_list.push_back(test);\
|
||||
}
|
||||
|
||||
struct test_base {
|
||||
std::string title;
|
||||
virtual void func() {}
|
||||
};
|
||||
|
||||
std::vector<test_base *> test_list;
|
||||
test_base *test;
|
||||
std::string test_title;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user