libcopp  1.1.0
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions | Private Attributes
test_manager Class Reference

#include <test_manager.h>

Collaboration diagram for test_manager:
Collaboration graph

Data Structures

struct  pick_param
 
struct  pick_param< TL, TR, false, true, true >
 
struct  pick_param< TL, TR, true, true, false >
 
struct  pick_param_str_t
 

Public Types

typedef test_case_basecase_ptr_type
 
typedef std::vector< std::pair< std::string, case_ptr_type > > test_type
 

Public Member Functions

typedef UTILS_TEST_ENV_AUTO_MAP (std::string, test_type) test_data_type
 
 test_manager ()
 
virtual ~test_manager ()
 
void append (const std::string &test_name, const std::string &case_name, case_ptr_type)
 
int run ()
 
void set_cases (const std::vector< std::string > &case_names)
 
template<typename TL , typename TR >
bool expect_eq (const TL &l, const TR &r, const char *lexpr, const char *rexpr, const char *file, size_t line)
 
template<typename TL , typename TR >
bool expect_ne (const TL &l, const TR &r, const char *lexpr, const char *rexpr, const char *file, size_t line)
 
template<typename TL , typename TR >
bool expect_lt (const TL &l, const TR &r, const char *lexpr, const char *rexpr, const char *file, size_t line)
 
template<typename TL , typename TR >
bool expect_le (const TL &l, const TR &r, const char *lexpr, const char *rexpr, const char *file, size_t line)
 
template<typename TL , typename TR >
bool expect_gt (const TL &l, const TR &r, const char *lexpr, const char *rexpr, const char *file, size_t line)
 
template<typename TL , typename TR >
bool expect_ge (const TL &l, const TR &r, const char *lexpr, const char *rexpr, const char *file, size_t line)
 
template<typename TL >
bool expect_true (const TL &l, const char *expr, const char *file, size_t line)
 
template<typename TL >
bool expect_false (const TL &l, const char *expr, const char *file, size_t line)
 

Static Public Member Functions

static test_managerme ()
 
static std::string get_expire_time (clock_t begin, clock_t end)
 

Data Fields

int * success_counter_ptr
 
int * failed_counter_ptr
 

Private Member Functions

 UTILS_TEST_ENV_AUTO_SET (std::string) run_cases_
 
 UTILS_TEST_ENV_AUTO_SET (std::string) run_groups_
 

Private Attributes

test_data_type tests_
 
int success_
 
int failed_
 

Detailed Description

Definition at line 47 of file test_manager.h.

Member Typedef Documentation

Definition at line 49 of file test_manager.h.

typedef std::vector<std::pair<std::string, case_ptr_type> > test_manager::test_type

Definition at line 50 of file test_manager.h.

Constructor & Destructor Documentation

test_manager::test_manager ( )

Definition at line 33 of file test_manager.cpp.

References failed_, failed_counter_ptr, success_, and success_counter_ptr.

test_manager::~test_manager ( )
virtual

Definition at line 39 of file test_manager.cpp.

Member Function Documentation

void test_manager::append ( const std::string &  test_name,
const std::string &  case_name,
case_ptr_type  ptr 
)

Definition at line 41 of file test_manager.cpp.

References run(), and tests_.

Referenced by test_case_base::test_case_base().

template<typename TL , typename TR >
bool test_manager::expect_eq ( const TL &  l,
const TR &  r,
const char *  lexpr,
const char *  rexpr,
const char *  file,
size_t  line 
)
inline

Definition at line 123 of file test_manager.h.

References util::cli::shell_font_style::SHELL_FONT_COLOR_RED.

template<typename TL >
bool test_manager::expect_false ( const TL &  l,
const char *  expr,
const char *  file,
size_t  line 
)
inline

Definition at line 264 of file test_manager.h.

References util::cli::shell_font_style::SHELL_FONT_COLOR_RED.

template<typename TL , typename TR >
bool test_manager::expect_ge ( const TL &  l,
const TR &  r,
const char *  lexpr,
const char *  rexpr,
const char *  file,
size_t  line 
)
inline

Definition at line 227 of file test_manager.h.

References util::cli::shell_font_style::SHELL_FONT_COLOR_RED.

template<typename TL , typename TR >
bool test_manager::expect_gt ( const TL &  l,
const TR &  r,
const char *  lexpr,
const char *  rexpr,
const char *  file,
size_t  line 
)
inline

Definition at line 206 of file test_manager.h.

References util::cli::shell_font_style::SHELL_FONT_COLOR_RED.

template<typename TL , typename TR >
bool test_manager::expect_le ( const TL &  l,
const TR &  r,
const char *  lexpr,
const char *  rexpr,
const char *  file,
size_t  line 
)
inline

Definition at line 185 of file test_manager.h.

References util::cli::shell_font_style::SHELL_FONT_COLOR_RED.

template<typename TL , typename TR >
bool test_manager::expect_lt ( const TL &  l,
const TR &  r,
const char *  lexpr,
const char *  rexpr,
const char *  file,
size_t  line 
)
inline

Definition at line 164 of file test_manager.h.

References util::cli::shell_font_style::SHELL_FONT_COLOR_RED.

template<typename TL , typename TR >
bool test_manager::expect_ne ( const TL &  l,
const TR &  r,
const char *  lexpr,
const char *  rexpr,
const char *  file,
size_t  line 
)
inline

Definition at line 143 of file test_manager.h.

References util::cli::shell_font_style::SHELL_FONT_COLOR_RED.

template<typename TL >
bool test_manager::expect_true ( const TL &  l,
const char *  expr,
const char *  file,
size_t  line 
)
inline

Definition at line 248 of file test_manager.h.

References util::cli::shell_font_style::SHELL_FONT_COLOR_RED.

std::string test_manager::get_expire_time ( clock_t  begin,
clock_t  end 
)
static

Definition at line 196 of file test_manager.cpp.

Referenced by run().

test_manager & test_manager::me ( )
static
int test_manager::run ( )
void test_manager::set_cases ( const std::vector< std::string > &  case_names)

Definition at line 178 of file test_manager.cpp.

Referenced by run_tests().

typedef test_manager::UTILS_TEST_ENV_AUTO_MAP ( std::string  ,
test_type   
)
test_manager::UTILS_TEST_ENV_AUTO_SET ( std::string  )
private
test_manager::UTILS_TEST_ENV_AUTO_SET ( std::string  )
private

Field Documentation

int test_manager::failed_
private

Definition at line 282 of file test_manager.h.

Referenced by run(), and test_manager().

int* test_manager::failed_counter_ptr

Definition at line 66 of file test_manager.h.

Referenced by test_case_base::run(), and test_manager().

int test_manager::success_
private

Definition at line 281 of file test_manager.h.

Referenced by run(), and test_manager().

int* test_manager::success_counter_ptr

Definition at line 65 of file test_manager.h.

Referenced by test_case_base::run(), and test_manager().

test_data_type test_manager::tests_
private

Definition at line 280 of file test_manager.h.

Referenced by append(), and run().


The documentation for this class was generated from the following files: