59 description(description),
69 virtual void run() = 0;
85 :
test(name, need_cuda), entrypoint(entrypoint)
89 :
test(name, description, need_cuda), entrypoint(entrypoint)
92 virtual void run(
void)
99 #define TEST_FUN(test_name, entrypoint) \
100 standalone_test test_name(entrypoint, #test_name, false)
103 #define TEST_FUN_CUDA(test_name, entrypoint) \
104 standalone_test test_name(entrypoint, #test_name, true)
108 #define TEST_FUN_HD(test_name, entrypoint) \
109 standalone_test test_name##_host(entrypoint<host>, #test_name "_host", false); \
110 standalone_test test_name##_cuda(entrypoint<cuda>, #test_name "_cuda", true)
113 #define TEST_REGISTER(test_name) \
114 test_list.push_back(&test_name)
117 #define TEST_REGISTER_HD(test_name) \
118 test_list.push_back(&test_name##_host); \
119 test_list.push_back(&test_name##_cuda)
127 #define lift_check(expr) \
130 printf("\n check failed at %s:%u: expression \"%s\"", __FILE__, __LINE__, #expr); \
132 current_test->test_passed = false; \
133 debug_check_failure(); \
137 #define lift_fail() \
138 printf("\n test failed at %s:%u", __FILE__, __LINE__); \
140 current_test->test_passed = false; \
141 debug_check_failure()
test(std::string name, std::string description, bool need_cuda)
standalone_test(callable entrypoint, std::string name, bool need_cuda)
standalone_test(callable entrypoint, std::string name, std::string description, bool need_cuda)
void debug_check_failure(void)
The test object interface.
thread_local test * current_test
Wrapper for standalone tests, which consist of a single function with no arguments and no return valu...
const std::string description
std::vector< test * > test_list
void generate_test_list(void)
test(std::string name, bool need_cuda)