extern const struct testcase_setup_t legacy_setup;
void run_legacy_test_fn(void *ptr);
+extern int libevent_tests_running_in_debug_mode;
+
/* A couple of flags that basic/legacy_setup can support. */
#define TT_NEED_SOCKETPAIR TT_FIRST_USER_FLAG
#define TT_NEED_BASE (TT_FIRST_USER_FLAG<<1)
allocated_chunks = 0;
event_set_mem_functions(cnt_malloc, cnt_realloc, cnt_free);
- event_enable_debug_mode();
+ if (!libevent_tests_running_in_debug_mode)
+ event_enable_debug_mode();
/* not mm_calloc: we don't want to mess with the count. */
env = calloc(1, sizeof(struct testleak_env_t));
tt_skip();
#endif
- event_enable_debug_mode();
+ if (!libevent_tests_running_in_debug_mode)
+ event_enable_debug_mode();
base = event_base_new();
END_OF_ALIASES
};
+int libevent_tests_running_in_debug_mode = 0;
+
int
main(int argc, const char **argv)
{
evthread_enable_lock_debugging();
#endif
- if (getenv("EVENT_DEBUG_MODE"))
+ if (getenv("EVENT_DEBUG_MODE")) {
event_enable_debug_mode();
+ libevent_tests_running_in_debug_mode = 1;
+ }
tinytest_set_aliases(testaliases);