libcopp  1.1.0
Macros
test_macros.h File Reference
#include <iostream>
#include <sstream>
#include <cstdio>
#include "test_manager.h"
#include <unistd.h>
Include dependency graph for test_macros.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define test_case_func_name(test_name, case_name)   test_func_test_##test_name##_case_##case_name
 
#define test_case_obj_name(test_name, case_name)   test_obj_test_##test_name##_case_##case_name##_obj
 
#define CASE_TEST(test_name, case_name)
 
#define CASE_EXPECT_TRUE(c)   test_manager::me().expect_true((c), #c, __FILE__, __LINE__)
 
#define CASE_EXPECT_FALSE(c)   test_manager::me().expect_false((c), #c, __FILE__, __LINE__)
 
#define CASE_EXPECT_EQ(l, r)   test_manager::me().expect_eq((l), (r), #l, #r, __FILE__, __LINE__)
 
#define CASE_EXPECT_NE(l, r)   test_manager::me().expect_ne((l), (r), #l, #r, __FILE__, __LINE__)
 
#define CASE_EXPECT_LT(l, r)   test_manager::me().expect_lt((l), (r), #l, #r, __FILE__, __LINE__)
 
#define CASE_EXPECT_LE(l, r)   test_manager::me().expect_le((l), (r), #l, #r, __FILE__, __LINE__)
 
#define CASE_EXPECT_GT(l, r)   test_manager::me().expect_gt((l), (r), #l, #r, __FILE__, __LINE__)
 
#define CASE_EXPECT_GE(l, r)   test_manager::me().expect_ge((l), (r), #l, #r, __FILE__, __LINE__)
 
#define CASE_MSG_FCOLOR(x)   util::cli::shell_font_style::SHELL_FONT_COLOR_##x
 
#define CASE_MSG_BCOLOR(x)   util::cli::shell_font_style::SHELL_FONT_BACKGROUND_COLOR_##x
 
#define CASE_MSG_STYLE(x)   util::cli::shell_font_style::SHELL_FONT_SPEC_##x
 
#define CASE_MSG_INFO()   util::cli::shell_stream(std::cout)()<< "[ RUNNING ] "
 
#define CASE_MSG_ERROR()   util::cli::shell_stream(std::cerr)()<< "[ RUNNING ] "
 
#define CASE_THREAD_SLEEP_MS(x)   ((x > 1000)? sleep(x / 1000): usleep(0)); usleep((x % 1000) * 1000)
 
#define CASE_THREAD_YIELD()
 

Macro Definition Documentation

#define CASE_EXPECT_EQ (   l,
 
)    test_manager::me().expect_eq((l), (r), #l, #r, __FILE__, __LINE__)
#define CASE_EXPECT_FALSE (   c)    test_manager::me().expect_false((c), #c, __FILE__, __LINE__)

Definition at line 61 of file test_macros.h.

#define CASE_EXPECT_GE (   l,
 
)    test_manager::me().expect_ge((l), (r), #l, #r, __FILE__, __LINE__)

Definition at line 67 of file test_macros.h.

Referenced by CASE_TEST().

#define CASE_EXPECT_GT (   l,
 
)    test_manager::me().expect_gt((l), (r), #l, #r, __FILE__, __LINE__)

Definition at line 66 of file test_macros.h.

#define CASE_EXPECT_LE (   l,
 
)    test_manager::me().expect_le((l), (r), #l, #r, __FILE__, __LINE__)

Definition at line 65 of file test_macros.h.

#define CASE_EXPECT_LT (   l,
 
)    test_manager::me().expect_lt((l), (r), #l, #r, __FILE__, __LINE__)

Definition at line 64 of file test_macros.h.

#define CASE_EXPECT_NE (   l,
 
)    test_manager::me().expect_ne((l), (r), #l, #r, __FILE__, __LINE__)

Definition at line 63 of file test_macros.h.

#define CASE_EXPECT_TRUE (   c)    test_manager::me().expect_true((c), #c, __FILE__, __LINE__)

Definition at line 60 of file test_macros.h.

Referenced by CASE_TEST().

#define CASE_MSG_BCOLOR (   x)    util::cli::shell_font_style::SHELL_FONT_BACKGROUND_COLOR_##x

Definition at line 76 of file test_macros.h.

#define CASE_MSG_ERROR ( )    util::cli::shell_stream(std::cerr)()<< "[ RUNNING ] "

Definition at line 81 of file test_macros.h.

#define CASE_MSG_FCOLOR (   x)    util::cli::shell_font_style::SHELL_FONT_COLOR_##x

Definition at line 74 of file test_macros.h.

#define CASE_MSG_INFO ( )    util::cli::shell_stream(std::cout)()<< "[ RUNNING ] "

Definition at line 80 of file test_macros.h.

#define CASE_MSG_STYLE (   x)    util::cli::shell_font_style::SHELL_FONT_SPEC_##x

Definition at line 78 of file test_macros.h.

#define CASE_TEST (   test_name,
  case_name 
)
Value:
static void test_case_func_name(test_name, case_name) (); \
static test_case_base test_case_obj_name(test_name, case_name) (#test_name, #case_name, test_case_func_name(test_name, case_name)); \
void test_case_func_name(test_name, case_name) ()
#define test_case_obj_name(test_name, case_name)
Definition: test_macros.h:41
#define test_case_func_name(test_name, case_name)
Definition: test_macros.h:40

Definition at line 43 of file test_macros.h.

#define CASE_THREAD_SLEEP_MS (   x)    ((x > 1000)? sleep(x / 1000): usleep(0)); usleep((x % 1000) * 1000)

Definition at line 97 of file test_macros.h.

#define CASE_THREAD_YIELD ( )

Definition at line 126 of file test_macros.h.

#define test_case_func_name (   test_name,
  case_name 
)    test_func_test_##test_name##_case_##case_name

Definition at line 40 of file test_macros.h.

#define test_case_obj_name (   test_name,
  case_name 
)    test_obj_test_##test_name##_case_##case_name##_obj

Definition at line 41 of file test_macros.h.