libcopp  2.2.0
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | 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 test_on_start_baseon_start_ptr_type
 
typedef test_on_exit_baseon_exit_ptr_type
 
typedef std::vector< std::pair< std::string, case_ptr_type > > test_type
 
typedef std::vector< std::pair< std::string, on_start_ptr_type > > event_on_start_type
 
typedef std::vector< std::pair< std::string, on_exit_ptr_type > > event_on_exit_type
 

Public Member Functions

typedef UTILS_TEST_ENV_AUTO_MAP (std::string, test_type) test_data_type
 
 test_manager ()
 
virtual ~test_manager ()
 
void append_test_case (const std::string &test_name, const std::string &case_name, case_ptr_type)
 
void append_event_on_start (const std::string &event_name, on_start_ptr_type)
 
void append_event_on_exit (const std::string &event_name, on_exit_ptr_type)
 
int run_event_on_start ()
 
int run_event_on_exit ()
 
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)
 
static void set_counter_ptr (int *success_counter_ptr, int *failed_counter_ptr)
 
static void inc_success_counter ()
 
static void inc_failed_counter ()
 

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_
 
event_on_start_type evt_on_starts_
 
event_on_exit_type evt_on_exits_
 
int success_
 
int failed_
 

Detailed Description

Definition at line 49 of file test_manager.h.

Member Typedef Documentation

◆ case_ptr_type

Definition at line 51 of file test_manager.h.

◆ event_on_exit_type

typedef std::vector<std::pair<std::string, on_exit_ptr_type> > test_manager::event_on_exit_type

Definition at line 56 of file test_manager.h.

◆ event_on_start_type

typedef std::vector<std::pair<std::string, on_start_ptr_type> > test_manager::event_on_start_type

Definition at line 55 of file test_manager.h.

◆ on_exit_ptr_type

Definition at line 53 of file test_manager.h.

◆ on_start_ptr_type

Definition at line 52 of file test_manager.h.

◆ test_type

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

Definition at line 54 of file test_manager.h.

Constructor & Destructor Documentation

◆ test_manager()

test_manager::test_manager ( )

Definition at line 143 of file test_manager.cpp.

References failed_, and success_.

◆ ~test_manager()

test_manager::~test_manager ( )
virtual

Definition at line 148 of file test_manager.cpp.

Member Function Documentation

◆ append_event_on_exit()

void test_manager::append_event_on_exit ( const std::string &  event_name,
on_exit_ptr_type  ptr 
)

Definition at line 158 of file test_manager.cpp.

References evt_on_exits_.

Referenced by test_on_exit_base::register_self().

◆ append_event_on_start()

void test_manager::append_event_on_start ( const std::string &  event_name,
on_start_ptr_type  ptr 
)

Definition at line 154 of file test_manager.cpp.

References evt_on_starts_.

Referenced by test_on_start_base::register_self().

◆ append_test_case()

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

Definition at line 150 of file test_manager.cpp.

References tests_.

Referenced by test_case_base::test_case_base().

◆ expect_eq()

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

◆ expect_false()

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

◆ expect_ge()

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

◆ expect_gt()

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

◆ expect_le()

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

◆ expect_lt()

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

◆ expect_ne()

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

◆ expect_true()

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

◆ get_expire_time()

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

Definition at line 432 of file test_manager.cpp.

Referenced by run().

◆ inc_failed_counter()

void test_manager::inc_failed_counter ( )
static

◆ inc_success_counter()

void test_manager::inc_success_counter ( )
static

◆ me()

test_manager & test_manager::me ( )
static

◆ run()

int test_manager::run ( )

◆ run_event_on_exit()

int test_manager::run_event_on_exit ( )

◆ run_event_on_start()

int test_manager::run_event_on_start ( )

◆ set_cases()

void test_manager::set_cases ( const std::vector< std::string > &  case_names)

Definition at line 414 of file test_manager.cpp.

Referenced by run_tests().

◆ set_counter_ptr()

void test_manager::set_counter_ptr ( int *  success_counter_ptr,
int *  failed_counter_ptr 
)
static

◆ UTILS_TEST_ENV_AUTO_MAP()

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

◆ UTILS_TEST_ENV_AUTO_SET() [1/2]

test_manager::UTILS_TEST_ENV_AUTO_SET ( std::string  )
private

◆ UTILS_TEST_ENV_AUTO_SET() [2/2]

test_manager::UTILS_TEST_ENV_AUTO_SET ( std::string  )
private

Field Documentation

◆ evt_on_exits_

event_on_exit_type test_manager::evt_on_exits_
private

Definition at line 303 of file test_manager.h.

Referenced by append_event_on_exit(), and run_event_on_exit().

◆ evt_on_starts_

event_on_start_type test_manager::evt_on_starts_
private

Definition at line 302 of file test_manager.h.

Referenced by append_event_on_start(), and run_event_on_start().

◆ failed_

int test_manager::failed_
private

Definition at line 305 of file test_manager.h.

Referenced by run(), and test_manager().

◆ success_

int test_manager::success_
private

Definition at line 304 of file test_manager.h.

Referenced by run(), and test_manager().

◆ tests_

test_data_type test_manager::tests_
private

Definition at line 301 of file test_manager.h.

Referenced by append_test_case(), and run().


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