test: introduce TT_ENABLE_DEBUG_MODE flag

(cherry picked from commit 6186d3126f124494dd90b14f62c17b47f7a7f484)
This commit is contained in:
Azat Khuzhin 2019-08-26 22:43:35 +03:00
parent 4a6f1ccfae
commit 0126814f2f
2 changed files with 6 additions and 0 deletions

View File

@ -95,6 +95,7 @@ extern int libevent_tests_running_in_debug_mode;
#define TT_NO_LOGS (TT_FIRST_USER_FLAG<<5) #define TT_NO_LOGS (TT_FIRST_USER_FLAG<<5)
#define TT_ENABLE_IOCP_FLAG (TT_FIRST_USER_FLAG<<6) #define TT_ENABLE_IOCP_FLAG (TT_FIRST_USER_FLAG<<6)
#define TT_ENABLE_IOCP (TT_ENABLE_IOCP_FLAG|TT_NEED_THREADS) #define TT_ENABLE_IOCP (TT_ENABLE_IOCP_FLAG|TT_NEED_THREADS)
#define TT_ENABLE_DEBUG_MODE (TT_ENABLE_IOCP_FLAG<<7)
/* All the flags that a legacy test needs. */ /* All the flags that a legacy test needs. */
#define TT_ISOLATED TT_FORK|TT_NEED_SOCKETPAIR|TT_NEED_BASE #define TT_ISOLATED TT_FORK|TT_NEED_SOCKETPAIR|TT_NEED_BASE

View File

@ -197,6 +197,11 @@ basic_test_setup(const struct testcase_t *testcase)
if (testcase->flags & TT_ENABLE_IOCP_FLAG) if (testcase->flags & TT_ENABLE_IOCP_FLAG)
return (void*)TT_SKIP; return (void*)TT_SKIP;
#endif #endif
if (testcase->flags & TT_ENABLE_DEBUG_MODE) {
event_enable_debug_mode();
libevent_tests_running_in_debug_mode = 1;
}
if (testcase->flags & TT_NEED_THREADS) { if (testcase->flags & TT_NEED_THREADS) {
if (!(testcase->flags & TT_FORK)) if (!(testcase->flags & TT_FORK))