xref: /freebsd/contrib/ntp/sntp/libevent/test/include.am (revision 3078531de10dcae44b253a35125c949ff4235284)
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
45# We need to copy this file, since automake doesn't want us to use top_srcdir
46# in TESTS.
47TESTS = test/test-script.sh
48
49test/test-script.sh: test/test.sh
50	cp $(top_srcdir)/test/test.sh $@
51
52DISTCLEANFILES += test/test-script.sh
53DISTCLEANFILES += test/regress.gen.c test/regress.gen.h
54
55if BUILD_REGRESS
56BUILT_SOURCES += test/regress.gen.c test/regress.gen.h
57endif
58
59test_test_init_SOURCES = test/test-init.c
60test_test_init_LDADD = libevent_core.la
61test_test_dumpevents_SOURCES = test/test-dumpevents.c
62test_test_dumpevents_LDADD = libevent_core.la
63test_test_eof_SOURCES = test/test-eof.c
64test_test_eof_LDADD = libevent_core.la
65test_test_closed_SOURCES = test/test-closed.c
66test_test_closed_LDADD = libevent_core.la
67test_test_changelist_SOURCES = test/test-changelist.c
68test_test_changelist_LDADD = libevent_core.la
69test_test_weof_SOURCES = test/test-weof.c
70test_test_weof_LDADD = libevent_core.la
71test_test_time_SOURCES = test/test-time.c
72test_test_time_LDADD = libevent_core.la
73test_test_ratelim_SOURCES = test/test-ratelim.c
74test_test_ratelim_LDADD = libevent_core.la -lm
75test_test_fdleak_SOURCES = test/test-fdleak.c
76test_test_fdleak_LDADD = libevent_core.la
77
78test_regress_SOURCES = 				\
79	test/regress.c				\
80	test/regress.gen.c				\
81	test/regress.gen.h				\
82	test/regress_buffer.c			\
83	test/regress_bufferevent.c			\
84	test/regress_dns.c				\
85	test/regress_et.c				\
86	test/regress_finalize.c				\
87	test/regress_http.c				\
88	test/regress_listener.c			\
89	test/regress_main.c				\
90	test/regress_minheap.c			\
91	test/regress_rpc.c				\
92	test/regress_testutils.c			\
93	test/regress_testutils.h			\
94	test/regress_util.c				\
95	test/tinytest.c				\
96	$(regress_thread_SOURCES)		\
97	$(regress_zlib_SOURCES)
98
99if PTHREADS
100regress_thread_SOURCES = test/regress_thread.c
101PTHREAD_LIBS += libevent_pthreads.la
102endif
103if BUILD_WIN32
104regress_thread_SOURCES = test/regress_thread.c
105endif
106if ZLIB_REGRESS
107regress_zlib_SOURCES = test/regress_zlib.c
108endif
109if BUILD_WIN32
110test_regress_SOURCES += test/regress_iocp.c
111endif
112
113test_regress_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la $(PTHREAD_LIBS) $(ZLIB_LIBS)
114test_regress_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) $(ZLIB_CFLAGS) -Itest
115test_regress_LDFLAGS = $(PTHREAD_CFLAGS)
116
117if OPENSSL
118test_regress_SOURCES += test/regress_ssl.c
119test_regress_CPPFLAGS += $(OPENSSL_INCS)
120test_regress_LDADD += libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD}
121endif
122
123test_bench_SOURCES = test/bench.c
124test_bench_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
125test_bench_cascade_SOURCES = test/bench_cascade.c
126test_bench_cascade_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
127test_bench_http_SOURCES = test/bench_http.c
128test_bench_http_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
129test_bench_httpclient_SOURCES = test/bench_httpclient.c
130test_bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) libevent_core.la
131
132test/regress.gen.c test/regress.gen.h: test/rpcgen-attempted
133
134test/rpcgen-attempted: test/regress.rpc event_rpcgen.py test/rpcgen_wrapper.sh
135	$(AM_V_GEN)date -u > $@
136	$(AM_V_at)if $(srcdir)/test/rpcgen_wrapper.sh $(srcdir)/test; then \
137	   true; \
138	else \
139	   echo "No Python installed; stubbing out RPC test." >&2; \
140	   echo " "> test/regress.gen.c; \
141	   echo "#define NO_PYTHON_EXISTS" > test/regress.gen.h; \
142	fi
143
144CLEANFILES += test/rpcgen-attempted
145
146$(TESTPROGRAMS) : libevent.la
147