Lift
Library of parallel computing primitives for GPUs and multi-core CPUs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Classes | Namespaces | Macros | Functions | Variables
harness.h File Reference
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  lift::test
 The test object interface. More...
 
struct  lift::standalone_test
 Wrapper for standalone tests, which consist of a single function with no arguments and no return value. More...
 

Namespaces

 lift
 

Macros

#define TEST_FUN(test_name, entrypoint)   standalone_test test_name(entrypoint, #test_name, false)
 
#define TEST_FUN_CUDA(test_name, entrypoint)   standalone_test test_name(entrypoint, #test_name, true)
 
#define TEST_FUN_HD(test_name, entrypoint)
 
#define TEST_REGISTER(test_name)   test_list.push_back(&test_name)
 
#define TEST_REGISTER_HD(test_name)
 
#define lift_check(expr)
 
#define lift_fail()
 

Functions

void generate_test_list (void)
 
void debug_check_failure (void)
 

Variables

std::vector< test * > lift::test_list = { }
 
thread_local testlift::current_test = nullptr
 

Macro Definition Documentation

#define lift_check (   expr)
Value:
if (!(expr)) \
{ \
printf("\n check failed at %s:%u: expression \"%s\"", __FILE__, __LINE__, #expr); \
fflush(stdout); \
}
bool test_passed
Definition: harness.h:48
void debug_check_failure(void)
Definition: entrypoint.cu:51
thread_local test * current_test
Definition: entrypoint.cu:41

Definition at line 127 of file harness.h.

#define lift_fail ( )
Value:
printf("\n test failed at %s:%u", __FILE__, __LINE__); \
fflush(stdout); \
bool test_passed
Definition: harness.h:48
void debug_check_failure(void)
Definition: entrypoint.cu:51
thread_local test * current_test
Definition: entrypoint.cu:41

Definition at line 137 of file harness.h.

#define TEST_FUN (   test_name,
  entrypoint 
)    standalone_test test_name(entrypoint, #test_name, false)

Definition at line 99 of file harness.h.

#define TEST_FUN_CUDA (   test_name,
  entrypoint 
)    standalone_test test_name(entrypoint, #test_name, true)

Definition at line 103 of file harness.h.

#define TEST_FUN_HD (   test_name,
  entrypoint 
)
Value:
standalone_test test_name##_host(entrypoint<host>, #test_name "_host", false); \
standalone_test test_name##_cuda(entrypoint<cuda>, #test_name "_cuda", true)

Definition at line 108 of file harness.h.

#define TEST_REGISTER (   test_name)    test_list.push_back(&test_name)

Definition at line 113 of file harness.h.

#define TEST_REGISTER_HD (   test_name)
Value:
test_list.push_back(&test_name##_host); \
test_list.push_back(&test_name##_cuda)
std::vector< test * > test_list
Definition: entrypoint.cu:44

Definition at line 117 of file harness.h.

Function Documentation

void debug_check_failure ( void  )

Definition at line 51 of file entrypoint.cu.

void generate_test_list ( void  )