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