2012-02-10 17:29:53 -05:00
|
|
|
# test/Makefile.am for libevent
|
|
|
|
# Copyright 2000-2007 Niels Provos
|
|
|
|
# Copyright 2007-2012 Niels Provos and Nick Mathewson
|
|
|
|
#
|
|
|
|
# See LICENSE for copying information.
|
|
|
|
|
2012-08-28 15:58:18 -04:00
|
|
|
regress_CPPFLAGS = -DTINYTEST_LOCAL
|
|
|
|
|
|
|
|
EXTRA_DIST+= \
|
|
|
|
test/check-dumpevents.py \
|
|
|
|
test/regress.gen.c \
|
|
|
|
test/regress.gen.h \
|
|
|
|
test/regress.rpc \
|
|
|
|
test/rpcgen_wrapper.sh \
|
2017-05-01 21:55:00 +03:00
|
|
|
test/print-winsock-errors.c \
|
2012-08-28 15:58:18 -04:00
|
|
|
test/test.sh
|
|
|
|
|
|
|
|
TESTPROGRAMS = \
|
|
|
|
test/bench \
|
|
|
|
test/bench_cascade \
|
|
|
|
test/bench_http \
|
|
|
|
test/bench_httpclient \
|
|
|
|
test/test-changelist \
|
|
|
|
test/test-dumpevents \
|
|
|
|
test/test-eof \
|
Implemented EV_CLOSED event for epoll backend (EPOLLRDHUP).
- Added new EV_CLOSED event - detects premature connection close
by clients without the necessity of reading all the pending
data. Does not depend on EV_READ and/or EV_WRITE.
- Added new EV_FEATURE_EARLY_CLOSED feature for epoll.
Must be supported for listening to EV_CLOSED event.
- Added new regression test: test-closed.c
- All regression tests passed (test/regress and test/test.sh)
- strace output of test-closed using EV_CLOSED:
socketpair(PF_LOCAL, SOCK_STREAM, 0, [6, 7]) = 0
sendto(6, "test string\0", 12, 0, NULL, 0) = 12
shutdown(6, SHUT_WR) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLRDHUP, {u32=7, u64=7}}) = 0
epoll_wait(3, {{EPOLLRDHUP, {u32=7, u64=7}}}, 32, 3000) = 1
epoll_ctl(3, EPOLL_CTL_MOD, 7, {EPOLLRDHUP, {u32=7, u64=7}}) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 4), ...})
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYM...
write(1, "closed_cb: detected connection close "..., 45) = 45
2014-01-17 23:20:42 -02:00
|
|
|
test/test-closed \
|
2012-08-28 15:58:18 -04:00
|
|
|
test/test-fdleak \
|
|
|
|
test/test-init \
|
|
|
|
test/test-ratelim \
|
|
|
|
test/test-time \
|
|
|
|
test/test-weof \
|
|
|
|
test/regress
|
|
|
|
|
2011-04-23 02:35:17 -04:00
|
|
|
if BUILD_REGRESS
|
2013-03-15 09:33:13 -04:00
|
|
|
noinst_PROGRAMS += $(TESTPROGRAMS)
|
2012-08-28 15:58:18 -04:00
|
|
|
EXTRA_PROGRAMS+= test/regress
|
2013-03-15 09:33:13 -04:00
|
|
|
endif
|
2012-04-20 12:14:20 -04:00
|
|
|
|
2012-08-28 15:58:18 -04:00
|
|
|
noinst_HEADERS+= \
|
|
|
|
test/regress.h \
|
2013-03-28 14:13:19 -04:00
|
|
|
test/regress_thread.h \
|
2012-08-28 15:58:18 -04:00
|
|
|
test/tinytest.h \
|
|
|
|
test/tinytest_local.h \
|
|
|
|
test/tinytest_macros.h
|
2003-03-08 05:24:26 +00:00
|
|
|
|
2017-01-20 16:29:19 +03:00
|
|
|
TESTS = \
|
|
|
|
test_runner_epoll \
|
|
|
|
test_runner_select \
|
|
|
|
test_runner_kqueue \
|
|
|
|
test_runner_evport \
|
|
|
|
test_runner_devpoll \
|
|
|
|
test_runner_poll \
|
|
|
|
test_runner_win32 \
|
|
|
|
test_runner_timerfd \
|
|
|
|
test_runner_changelist \
|
|
|
|
test_runner_timerfd_changelist
|
|
|
|
LOG_COMPILER = true
|
|
|
|
TESTS_COMPILER = true
|
2013-02-08 22:10:05 -05:00
|
|
|
|
2017-06-28 12:29:29 +01:00
|
|
|
test_runner_epoll: $(top_srcdir)/test/test.sh
|
|
|
|
$(top_srcdir)/test/test.sh -b EPOLL
|
|
|
|
test_runner_select: $(top_srcdir)/test/test.sh
|
|
|
|
$(top_srcdir)/test/test.sh -b SELECT
|
|
|
|
test_runner_kqueue: $(top_srcdir)/test/test.sh
|
|
|
|
$(top_srcdir)/test/test.sh -b KQUEUE
|
|
|
|
test_runner_evport: $(top_srcdir)/test/test.sh
|
|
|
|
$(top_srcdir)/test/test.sh -b EVPORT
|
|
|
|
test_runner_devpoll: $(top_srcdir)/test/test.sh
|
|
|
|
$(top_srcdir)/test/test.sh -b DEVPOLL
|
|
|
|
test_runner_poll: $(top_srcdir)/test/test.sh
|
|
|
|
$(top_srcdir)/test/test.sh -b POLL
|
|
|
|
test_runner_win32: $(top_srcdir)/test/test.sh
|
|
|
|
$(top_srcdir)/test/test.sh -b WIN32
|
|
|
|
test_runner_timerfd: $(top_srcdir)/test/test.sh
|
|
|
|
$(top_srcdir)/test/test.sh -b "" -t
|
|
|
|
test_runner_changelist: $(top_srcdir)/test/test.sh
|
|
|
|
$(top_srcdir)/test/test.sh -b "" -c
|
|
|
|
test_runner_timerfd_changelist: $(top_srcdir)/test/test.sh
|
|
|
|
$(top_srcdir)/test/test.sh -b "" -T
|
2013-02-08 22:10:05 -05:00
|
|
|
|
2014-03-06 10:18:09 -05:00
|
|
|
DISTCLEANFILES += test/regress.gen.c test/regress.gen.h
|
2010-03-12 13:09:28 -05:00
|
|
|
|
2011-02-13 02:05:04 -05:00
|
|
|
if BUILD_REGRESS
|
2012-08-28 15:58:18 -04:00
|
|
|
BUILT_SOURCES += test/regress.gen.c test/regress.gen.h
|
2011-02-13 02:05:04 -05:00
|
|
|
endif
|
|
|
|
|
2012-08-28 15:58:18 -04:00
|
|
|
test_test_init_SOURCES = test/test-init.c
|
|
|
|
test_test_init_LDADD = libevent_core.la
|
|
|
|
test_test_dumpevents_SOURCES = test/test-dumpevents.c
|
|
|
|
test_test_dumpevents_LDADD = libevent_core.la
|
|
|
|
test_test_eof_SOURCES = test/test-eof.c
|
|
|
|
test_test_eof_LDADD = libevent_core.la
|
Implemented EV_CLOSED event for epoll backend (EPOLLRDHUP).
- Added new EV_CLOSED event - detects premature connection close
by clients without the necessity of reading all the pending
data. Does not depend on EV_READ and/or EV_WRITE.
- Added new EV_FEATURE_EARLY_CLOSED feature for epoll.
Must be supported for listening to EV_CLOSED event.
- Added new regression test: test-closed.c
- All regression tests passed (test/regress and test/test.sh)
- strace output of test-closed using EV_CLOSED:
socketpair(PF_LOCAL, SOCK_STREAM, 0, [6, 7]) = 0
sendto(6, "test string\0", 12, 0, NULL, 0) = 12
shutdown(6, SHUT_WR) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLRDHUP, {u32=7, u64=7}}) = 0
epoll_wait(3, {{EPOLLRDHUP, {u32=7, u64=7}}}, 32, 3000) = 1
epoll_ctl(3, EPOLL_CTL_MOD, 7, {EPOLLRDHUP, {u32=7, u64=7}}) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 4), ...})
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYM...
write(1, "closed_cb: detected connection close "..., 45) = 45
2014-01-17 23:20:42 -02:00
|
|
|
test_test_closed_SOURCES = test/test-closed.c
|
|
|
|
test_test_closed_LDADD = libevent_core.la
|
2012-08-28 15:58:18 -04:00
|
|
|
test_test_changelist_SOURCES = test/test-changelist.c
|
|
|
|
test_test_changelist_LDADD = libevent_core.la
|
|
|
|
test_test_weof_SOURCES = test/test-weof.c
|
|
|
|
test_test_weof_LDADD = libevent_core.la
|
|
|
|
test_test_time_SOURCES = test/test-time.c
|
|
|
|
test_test_time_LDADD = libevent_core.la
|
|
|
|
test_test_ratelim_SOURCES = test/test-ratelim.c
|
|
|
|
test_test_ratelim_LDADD = libevent_core.la -lm
|
|
|
|
test_test_fdleak_SOURCES = test/test-fdleak.c
|
|
|
|
test_test_fdleak_LDADD = libevent_core.la
|
|
|
|
|
|
|
|
test_regress_SOURCES = \
|
|
|
|
test/regress.c \
|
|
|
|
test/regress.gen.c \
|
|
|
|
test/regress.gen.h \
|
|
|
|
test/regress_buffer.c \
|
|
|
|
test/regress_bufferevent.c \
|
|
|
|
test/regress_dns.c \
|
|
|
|
test/regress_et.c \
|
2013-03-28 14:13:19 -04:00
|
|
|
test/regress_finalize.c \
|
2012-08-28 15:58:18 -04:00
|
|
|
test/regress_http.c \
|
|
|
|
test/regress_listener.c \
|
|
|
|
test/regress_main.c \
|
|
|
|
test/regress_minheap.c \
|
|
|
|
test/regress_rpc.c \
|
|
|
|
test/regress_testutils.c \
|
|
|
|
test/regress_testutils.h \
|
|
|
|
test/regress_util.c \
|
|
|
|
test/tinytest.c \
|
2012-04-20 12:14:20 -04:00
|
|
|
$(regress_thread_SOURCES) \
|
|
|
|
$(regress_zlib_SOURCES)
|
|
|
|
|
2009-01-21 07:51:25 +00:00
|
|
|
if PTHREADS
|
2012-08-28 15:58:18 -04:00
|
|
|
regress_thread_SOURCES = test/regress_thread.c
|
|
|
|
PTHREAD_LIBS += libevent_pthreads.la
|
2008-03-02 21:18:33 +00:00
|
|
|
endif
|
2010-08-16 12:38:22 -04:00
|
|
|
if BUILD_WIN32
|
2016-08-07 22:19:39 +03:00
|
|
|
if THREADS
|
2012-08-28 15:58:18 -04:00
|
|
|
regress_thread_SOURCES = test/regress_thread.c
|
2010-08-16 12:38:22 -04:00
|
|
|
endif
|
2016-08-07 22:19:39 +03:00
|
|
|
endif
|
2008-04-30 04:31:10 +00:00
|
|
|
if ZLIB_REGRESS
|
2012-08-28 15:58:18 -04:00
|
|
|
regress_zlib_SOURCES = test/regress_zlib.c
|
2008-04-30 04:31:10 +00:00
|
|
|
endif
|
2009-04-30 19:05:43 +00:00
|
|
|
if BUILD_WIN32
|
2012-08-28 15:58:18 -04:00
|
|
|
test_regress_SOURCES += test/regress_iocp.c
|
2009-04-30 19:05:43 +00:00
|
|
|
endif
|
2009-07-28 04:03:57 +00:00
|
|
|
|
2019-03-25 01:40:46 +03:00
|
|
|
test_regress_LDADD = $(LIBEVENT_GC_SECTIONS) libevent_core.la libevent_extra.la $(PTHREAD_LIBS) $(ZLIB_LIBS)
|
2013-09-15 21:48:15 +02:00
|
|
|
test_regress_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) $(ZLIB_CFLAGS) -Itest
|
2012-08-28 15:58:18 -04:00
|
|
|
test_regress_LDFLAGS = $(PTHREAD_CFLAGS)
|
2009-01-29 23:19:57 +00:00
|
|
|
|
2009-07-28 04:03:57 +00:00
|
|
|
if OPENSSL
|
2012-08-28 15:58:18 -04:00
|
|
|
test_regress_SOURCES += test/regress_ssl.c
|
2012-11-15 11:40:33 -05:00
|
|
|
test_regress_CPPFLAGS += $(OPENSSL_INCS)
|
|
|
|
test_regress_LDADD += libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD}
|
2009-07-28 04:03:57 +00:00
|
|
|
endif
|
|
|
|
|
2012-08-28 15:58:18 -04:00
|
|
|
test_bench_SOURCES = test/bench.c
|
|
|
|
test_bench_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
|
|
|
|
test_bench_cascade_SOURCES = test/bench_cascade.c
|
|
|
|
test_bench_cascade_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
|
|
|
|
test_bench_http_SOURCES = test/bench_http.c
|
|
|
|
test_bench_http_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
|
|
|
|
test_bench_httpclient_SOURCES = test/bench_httpclient.c
|
|
|
|
test_bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) libevent_core.la
|
2005-08-22 01:34:34 +00:00
|
|
|
|
2012-08-28 15:58:18 -04:00
|
|
|
test/regress.gen.c test/regress.gen.h: test/rpcgen-attempted
|
2011-08-15 14:40:32 -04:00
|
|
|
|
2012-08-28 15:58:18 -04:00
|
|
|
test/rpcgen-attempted: test/regress.rpc event_rpcgen.py test/rpcgen_wrapper.sh
|
2012-08-28 16:07:56 -04:00
|
|
|
$(AM_V_GEN)date -u > $@
|
|
|
|
$(AM_V_at)if $(srcdir)/test/rpcgen_wrapper.sh $(srcdir)/test; then \
|
2012-08-28 16:14:38 -04:00
|
|
|
true; \
|
2011-06-14 14:37:49 -04:00
|
|
|
else \
|
2011-08-15 14:40:32 -04:00
|
|
|
echo "No Python installed; stubbing out RPC test." >&2; \
|
2012-08-28 16:15:14 -04:00
|
|
|
echo " "> test/regress.gen.c; \
|
|
|
|
echo "#define NO_PYTHON_EXISTS" > test/regress.gen.h; \
|
2011-06-14 14:37:49 -04:00
|
|
|
fi
|
2003-03-08 05:24:26 +00:00
|
|
|
|
2012-08-28 15:58:18 -04:00
|
|
|
CLEANFILES += test/rpcgen-attempted
|
2011-08-15 14:40:32 -04:00
|
|
|
|
2012-08-28 15:58:18 -04:00
|
|
|
$(TESTPROGRAMS) : libevent.la
|