xref: /freebsd/contrib/libevent/test/include.am (revision 911f0260390e18cf85f3dbf2c719b593efdc1e3c)
1# test/Makefile.am for libevent
2# Copyright 2000-2007 Niels Provos
3# Copyright 2007-2012 Niels Provos and Nick Mathewson
4#
5# See LICENSE for copying information.
6
7regress_CPPFLAGS = -DTINYTEST_LOCAL
8
9EXTRA_DIST+=					\
10	test/check-dumpevents.py		\
11	test/regress.gen.c			\
12	test/regress.gen.h				\
13	test/regress.rpc				\
14	test/rpcgen_wrapper.sh			\
15	test/test.sh
16
17TESTPROGRAMS = \
18	test/bench					\
19	test/bench_cascade				\
20	test/bench_http				\
21	test/bench_httpclient			\
22	test/test-changelist				\
23	test/test-dumpevents				\
24	test/test-eof				\
25	test/test-closed				\
26	test/test-fdleak				\
27	test/test-init				\
28	test/test-ratelim				\
29	test/test-time				\
30	test/test-weof \
31	test/regress
32
33if BUILD_REGRESS
34noinst_PROGRAMS += $(TESTPROGRAMS)
35EXTRA_PROGRAMS+= test/regress
36endif
37
38noinst_HEADERS+=				\
39	test/regress.h				\
40	test/regress_thread.h			\
41	test/tinytest.h				\
42	test/tinytest_local.h			\
43	test/tinytest_macros.h
44
45TESTS = \
46	test_runner_epoll \
47	test_runner_select \
48	test_runner_kqueue \
49	test_runner_evport \
50	test_runner_devpoll \
51	test_runner_poll \
52	test_runner_win32 \
53	test_runner_timerfd \
54	test_runner_changelist \
55	test_runner_timerfd_changelist
56LOG_COMPILER = true
57TESTS_COMPILER = true
58
59test_runner_epoll: test/test.sh
60	test/test.sh -b EPOLL
61test_runner_select: test/test.sh
62	test/test.sh -b SELECT
63test_runner_kqueue: test/test.sh
64	test/test.sh -b KQUEUE
65test_runner_evport: test/test.sh
66	test/test.sh -b EVPORT
67test_runner_devpoll: test/test.sh
68	test/test.sh -b DEVPOLL
69test_runner_poll: test/test.sh
70	test/test.sh -b POLL
71test_runner_win32: test/test.sh
72	test/test.sh -b WIN32
73test_runner_timerfd: test/test.sh
74	test/test.sh -b "" -t
75test_runner_changelist: test/test.sh
76	test/test.sh -b "" -c
77test_runner_timerfd_changelist: test/test.sh
78	test/test.sh -b "" -T
79
80DISTCLEANFILES += test/regress.gen.c test/regress.gen.h
81
82if BUILD_REGRESS
83BUILT_SOURCES += test/regress.gen.c test/regress.gen.h
84endif
85
86test_test_init_SOURCES = test/test-init.c
87test_test_init_LDADD = libevent_core.la
88test_test_dumpevents_SOURCES = test/test-dumpevents.c
89test_test_dumpevents_LDADD = libevent_core.la
90test_test_eof_SOURCES = test/test-eof.c
91test_test_eof_LDADD = libevent_core.la
92test_test_closed_SOURCES = test/test-closed.c
93test_test_closed_LDADD = libevent_core.la
94test_test_changelist_SOURCES = test/test-changelist.c
95test_test_changelist_LDADD = libevent_core.la
96test_test_weof_SOURCES = test/test-weof.c
97test_test_weof_LDADD = libevent_core.la
98test_test_time_SOURCES = test/test-time.c
99test_test_time_LDADD = libevent_core.la
100test_test_ratelim_SOURCES = test/test-ratelim.c
101test_test_ratelim_LDADD = libevent_core.la -lm
102test_test_fdleak_SOURCES = test/test-fdleak.c
103test_test_fdleak_LDADD = libevent_core.la
104
105test_regress_SOURCES = 				\
106	test/regress.c				\
107	test/regress.gen.c				\
108	test/regress.gen.h				\
109	test/regress_buffer.c			\
110	test/regress_bufferevent.c			\
111	test/regress_dns.c				\
112	test/regress_et.c				\
113	test/regress_finalize.c				\
114	test/regress_http.c				\
115	test/regress_listener.c			\
116	test/regress_main.c				\
117	test/regress_minheap.c			\
118	test/regress_rpc.c				\
119	test/regress_testutils.c			\
120	test/regress_testutils.h			\
121	test/regress_util.c				\
122	test/tinytest.c				\
123	$(regress_thread_SOURCES)		\
124	$(regress_zlib_SOURCES)
125
126if PTHREADS
127regress_thread_SOURCES = test/regress_thread.c
128PTHREAD_LIBS += libevent_pthreads.la
129endif
130if BUILD_WIN32
131if THREADS
132regress_thread_SOURCES = test/regress_thread.c
133endif
134endif
135if ZLIB_REGRESS
136regress_zlib_SOURCES = test/regress_zlib.c
137endif
138if BUILD_WIN32
139test_regress_SOURCES += test/regress_iocp.c
140endif
141
142test_regress_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la $(PTHREAD_LIBS) $(ZLIB_LIBS)
143test_regress_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) $(ZLIB_CFLAGS) -Itest
144test_regress_LDFLAGS = $(PTHREAD_CFLAGS)
145
146if OPENSSL
147test_regress_SOURCES += test/regress_ssl.c
148test_regress_CPPFLAGS += $(OPENSSL_INCS)
149test_regress_LDADD += libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD}
150endif
151
152test_bench_SOURCES = test/bench.c
153test_bench_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
154test_bench_cascade_SOURCES = test/bench_cascade.c
155test_bench_cascade_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
156test_bench_http_SOURCES = test/bench_http.c
157test_bench_http_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
158test_bench_httpclient_SOURCES = test/bench_httpclient.c
159test_bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) libevent_core.la
160
161test/regress.gen.c test/regress.gen.h: test/rpcgen-attempted
162
163test/rpcgen-attempted: test/regress.rpc event_rpcgen.py test/rpcgen_wrapper.sh
164	$(AM_V_GEN)date -u > $@
165	$(AM_V_at)if $(srcdir)/test/rpcgen_wrapper.sh $(srcdir)/test; then \
166	   true; \
167	else \
168	   echo "No Python installed; stubbing out RPC test." >&2; \
169	   echo " "> test/regress.gen.c; \
170	   echo "#define NO_PYTHON_EXISTS" > test/regress.gen.h; \
171	fi
172
173CLEANFILES += test/rpcgen-attempted
174
175$(TESTPROGRAMS) : libevent.la
176