#if defined(SETENV_OK) && defined(UNSETENV_OK)
const char **basenames;
- char varbuf[128];
int i, n_methods=0;
- const char *defaultname;
+ char varbuf[128];
+ const char *defaultname, *ignoreenvname;
/* See if unsetenv works before we rely on it. */
setenv("EVENT_NOWAFFLES", "1", 1);
base = NULL;
/* Can we disable the method with EVENT_NOfoo ? */
- methodname_to_envvar(defaultname, varbuf, sizeof(varbuf));
- setenv(varbuf, "1", 1);
+ if (!strcmp(defaultname, "epoll (with changelist)")) {
+ setenv("EVENT_NOEPOLL", "1", 1);
+ ignoreenvname = "epoll";
+ } else {
+ methodname_to_envvar(defaultname, varbuf, sizeof(varbuf));
+ setenv(varbuf, "1", 1);
+ ignoreenvname = defaultname;
+ }
/* Use an empty cfg rather than NULL so a failure doesn't exit() */
cfg = event_config_new();
event_config_set_flag(cfg, EVENT_BASE_FLAG_IGNORE_ENV);
base = event_base_new_with_config(cfg);
tt_assert(base);
- tt_str_op(defaultname, ==, event_base_get_method(base));
+ tt_str_op(ignoreenvname, ==, event_base_get_method(base));
#else
tt_skip();
#endif
base = event_base_new();
if (!strcmp(event_base_get_method(base), "epoll") ||
- !strcmp(event_base_get_method(base), "kqueue"))
+ !strcmp(event_base_get_method(base), "epoll (with changelist)") ||
+ !strcmp(event_base_get_method(base), "kqueue"))
supports_et = 1;
else
supports_et = 0;
EVENT_NOPOLL=yes; export EVENT_NOPOLL
EVENT_NOSELECT=yes; export EVENT_NOSELECT
EVENT_NOEPOLL=yes; export EVENT_NOEPOLL
+ unset EVENT_EPOLL_USE_CHANGELIST
EVENT_NOEVPORT=yes; export EVENT_NOEVPORT
EVENT_NOWIN32=yes; export EVENT_NOWIN32
}
announce () {
- echo $@
- echo $@ >>"$TEST_OUTPUT_FILE"
+ echo "$@"
+ echo "$@" >>"$TEST_OUTPUT_FILE"
}
announce_n () {
- $ECHO -n $@
- echo $@ >>"$TEST_OUTPUT_FILE"
+ $ECHO -n "$@"
+ echo "$@" >>"$TEST_OUTPUT_FILE"
}
announce "EPOLL"
run_tests
+setup
+unset EVENT_NOEPOLL
+EVENT_EPOLL_USE_CHANGELIST=yes; export EVENT_EPOLL_USE_CHANGELIST
+announce "EPOLL (changelist)"
+run_tests
+
setup
unset EVENT_NOEVPORT
announce "EVPORT"