33 lines
516 B
C++
33 lines
516 B
C++
#ifndef TESTS_H
|
|
# define TESTS_H
|
|
|
|
#include "colors.h"
|
|
#include <vector>
|
|
#include <string>
|
|
|
|
# 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);\
|
|
}
|
|
|
|
# define TITLE(s) std::cout << "\n" B_PURPLE #s RESET "\n\n";
|
|
|
|
struct test_base {
|
|
std::string title;
|
|
virtual void func() {}
|
|
};
|
|
|
|
std::vector<test_base *> test_list;
|
|
test_base *test;
|
|
std::string test_title;
|
|
|
|
#endif
|