creation of tests.h

This commit is contained in:
hugogogo
2022-05-31 19:52:03 +02:00
parent 5e65691bc8
commit 0e51cc655c
4 changed files with 190 additions and 160 deletions

28
headers/tests.h Normal file
View 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