Skip to content

Commit

Permalink
test: introduce TT_ENABLE_DEBUG_MODE flag
Browse files Browse the repository at this point in the history
  • Loading branch information
azat committed Aug 26, 2019
1 parent f4e3c01 commit 6186d31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/regress.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ extern int libevent_tests_running_in_debug_mode;
#define TT_NO_LOGS (TT_FIRST_USER_FLAG<<5)
#define TT_ENABLE_IOCP_FLAG (TT_FIRST_USER_FLAG<<6)
#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. */
#define TT_ISOLATED TT_FORK|TT_NEED_SOCKETPAIR|TT_NEED_BASE
Expand Down
5 changes: 5 additions & 0 deletions test/regress_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ basic_test_setup(const struct testcase_t *testcase)
if (testcase->flags & TT_ENABLE_IOCP_FLAG)
return (void*)TT_SKIP;
#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_FORK))
Expand Down

0 comments on commit 6186d31

Please sign in to comment.