libcopp
2.2.0
|
#include <test_manager.h>
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_base * | case_ptr_type |
typedef test_on_start_base * | on_start_ptr_type |
typedef test_on_exit_base * | on_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_manager & | me () |
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_ |
Definition at line 49 of file test_manager.h.
Definition at line 51 of file test_manager.h.
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.
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.
Definition at line 53 of file test_manager.h.
Definition at line 52 of file test_manager.h.
typedef std::vector<std::pair<std::string, case_ptr_type> > test_manager::test_type |
Definition at line 54 of file test_manager.h.
test_manager::test_manager | ( | ) |
Definition at line 143 of file test_manager.cpp.
|
virtual |
Definition at line 148 of file test_manager.cpp.
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().
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().
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().
|
inline |
Definition at line 134 of file test_manager.h.
References inc_failed_counter(), inc_success_counter(), and util::cli::shell_font_style::SHELL_FONT_COLOR_RED.
|
inline |
Definition at line 281 of file test_manager.h.
References inc_failed_counter(), inc_success_counter(), and util::cli::shell_font_style::SHELL_FONT_COLOR_RED.
|
inline |
Definition at line 243 of file test_manager.h.
References inc_failed_counter(), inc_success_counter(), and util::cli::shell_font_style::SHELL_FONT_COLOR_RED.
|
inline |
Definition at line 221 of file test_manager.h.
References inc_failed_counter(), inc_success_counter(), and util::cli::shell_font_style::SHELL_FONT_COLOR_RED.
|
inline |
Definition at line 199 of file test_manager.h.
References inc_failed_counter(), inc_success_counter(), and util::cli::shell_font_style::SHELL_FONT_COLOR_RED.
|
inline |
Definition at line 177 of file test_manager.h.
References inc_failed_counter(), inc_success_counter(), and util::cli::shell_font_style::SHELL_FONT_COLOR_RED.
|
inline |
Definition at line 155 of file test_manager.h.
References inc_failed_counter(), inc_success_counter(), and util::cli::shell_font_style::SHELL_FONT_COLOR_RED.
|
inline |
Definition at line 265 of file test_manager.h.
References inc_failed_counter(), inc_success_counter(), and util::cli::shell_font_style::SHELL_FONT_COLOR_RED.
|
static |
Definition at line 432 of file test_manager.cpp.
Referenced by run().
|
static |
Definition at line 464 of file test_manager.cpp.
References COPP_LIKELY_IF, detail::test_manager_tls_block_t::failed_counter_ptr, detail::get_test_manager_tls_block(), util::cli::shell_font_style::SHELL_FONT_COLOR_RED, and util::cli::shell_font_style::SHELL_FONT_SPEC_BOLD.
Referenced by expect_eq(), expect_false(), expect_ge(), expect_gt(), expect_le(), expect_lt(), expect_ne(), and expect_true().
|
static |
Definition at line 451 of file test_manager.cpp.
References COPP_LIKELY_IF, detail::get_test_manager_tls_block(), util::cli::shell_font_style::SHELL_FONT_COLOR_RED, util::cli::shell_font_style::SHELL_FONT_SPEC_BOLD, and detail::test_manager_tls_block_t::success_counter_ptr.
Referenced by expect_eq(), expect_false(), expect_ge(), expect_gt(), expect_le(), expect_lt(), expect_ne(), and expect_true().
|
static |
Definition at line 427 of file test_manager.cpp.
Referenced by test_on_start_base::register_self(), test_on_exit_base::register_self(), run_event_on_exit(), run_event_on_start(), run_tests(), and test_case_base::test_case_base().
int test_manager::run | ( | ) |
Definition at line 304 of file test_manager.cpp.
References failed_, get_expire_time(), util::cli::shell_font_style::SHELL_FONT_COLOR_GREEN, util::cli::shell_font_style::SHELL_FONT_COLOR_RED, util::cli::shell_font_style::SHELL_FONT_SPEC_BOLD, util::cli::shell_font_style::SHELL_FONT_SPEC_NULL, success_, and tests_.
Referenced by run_event_on_exit(), run_event_on_start(), and run_tests().
int test_manager::run_event_on_exit | ( | ) |
Definition at line 258 of file test_manager.cpp.
References detail::topological_sort_object_t::dependency_count, evt_on_exits_, detail::topological_sort_object_t::name, detail::topological_sort_object_t::object, run(), util::cli::shell_font_style::SHELL_FONT_COLOR_GREEN, util::cli::shell_font_style::SHELL_FONT_SPEC_BOLD, util::cli::shell_font_style::SHELL_FONT_SPEC_NULL, topological_sort(), and UTIL_UNIT_TEST_MACRO_AUTO_MAP.
Referenced by run_event_on_exit(), and run_tests().
int test_manager::run_event_on_start | ( | ) |
Definition at line 213 of file test_manager.cpp.
References detail::topological_sort_object_t::dependency_count, evt_on_starts_, detail::topological_sort_object_t::name, detail::topological_sort_object_t::object, run(), util::cli::shell_font_style::SHELL_FONT_COLOR_GREEN, util::cli::shell_font_style::SHELL_FONT_SPEC_BOLD, util::cli::shell_font_style::SHELL_FONT_SPEC_NULL, topological_sort(), and UTIL_UNIT_TEST_MACRO_AUTO_MAP.
Referenced by run_event_on_start(), and run_tests().
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().
|
static |
Definition at line 441 of file test_manager.cpp.
References detail::test_manager_tls_block_t::failed_counter_ptr, detail::g_global_counter_cache, detail::get_test_manager_tls_block(), and detail::test_manager_tls_block_t::success_counter_ptr.
Referenced by test_case_base::run().
typedef test_manager::UTILS_TEST_ENV_AUTO_MAP | ( | std::string | , |
test_type | |||
) |
|
private |
|
private |
|
private |
Definition at line 303 of file test_manager.h.
Referenced by append_event_on_exit(), and run_event_on_exit().
|
private |
Definition at line 302 of file test_manager.h.
Referenced by append_event_on_start(), and run_event_on_start().
|
private |
Definition at line 305 of file test_manager.h.
Referenced by run(), and test_manager().
|
private |
Definition at line 304 of file test_manager.h.
Referenced by run(), and test_manager().
|
private |
Definition at line 301 of file test_manager.h.
Referenced by append_test_case(), and run().