mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
243386ccc2
Currently an out-of-tree build will either write to the src dir or reuse the existing regress.gen.[c,h]. But if building from a read-only git tree (or if the git dir is cleaned), these files will not exist and the build fails. So write the files to the build dir. If the system does not have python, the regress.gen.[c,h] will be used from the src dir if they exist.
143 lines
4.0 KiB
Plaintext
143 lines
4.0 KiB
Plaintext
# test/Makefile.am for libevent
|
|
# Copyright 2000-2007 Niels Provos
|
|
# Copyright 2007-2012 Niels Provos and Nick Mathewson
|
|
#
|
|
# See LICENSE for copying information.
|
|
|
|
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 \
|
|
test/test.sh
|
|
|
|
TESTPROGRAMS = \
|
|
test/bench \
|
|
test/bench_cascade \
|
|
test/bench_http \
|
|
test/bench_httpclient \
|
|
test/test-changelist \
|
|
test/test-dumpevents \
|
|
test/test-eof \
|
|
test/test-fdleak \
|
|
test/test-init \
|
|
test/test-ratelim \
|
|
test/test-time \
|
|
test/test-weof \
|
|
test/regress
|
|
|
|
if BUILD_REGRESS
|
|
noinst_PROGRAMS += $(TESTPROGRAMS)
|
|
EXTRA_PROGRAMS+= test/regress
|
|
endif
|
|
|
|
noinst_HEADERS+= \
|
|
test/regress.h \
|
|
test/regress_thread.h \
|
|
test/tinytest.h \
|
|
test/tinytest_local.h \
|
|
test/tinytest_macros.h
|
|
|
|
# We need to copy this file, since automake doesn't want us to use top_srcdir
|
|
# in TESTS.
|
|
TESTS = test/test-script.sh
|
|
|
|
test/test-script.sh: test/test.sh
|
|
cp $(top_srcdir)/test/test.sh $@
|
|
|
|
DISTCLEANFILES += test/test-script.sh
|
|
|
|
if BUILD_REGRESS
|
|
BUILT_SOURCES += test/regress.gen.c test/regress.gen.h
|
|
endif
|
|
|
|
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
|
|
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 \
|
|
test/regress_finalize.c \
|
|
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 \
|
|
$(regress_thread_SOURCES) \
|
|
$(regress_zlib_SOURCES)
|
|
|
|
if PTHREADS
|
|
regress_thread_SOURCES = test/regress_thread.c
|
|
PTHREAD_LIBS += libevent_pthreads.la
|
|
endif
|
|
if BUILD_WIN32
|
|
regress_thread_SOURCES = test/regress_thread.c
|
|
endif
|
|
if ZLIB_REGRESS
|
|
regress_zlib_SOURCES = test/regress_zlib.c
|
|
endif
|
|
if BUILD_WIN32
|
|
test_regress_SOURCES += test/regress_iocp.c
|
|
endif
|
|
|
|
test_regress_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la $(PTHREAD_LIBS) $(ZLIB_LIBS)
|
|
test_regress_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) $(ZLIB_CFLAGS) -Itest
|
|
test_regress_LDFLAGS = $(PTHREAD_CFLAGS)
|
|
|
|
if OPENSSL
|
|
test_regress_SOURCES += test/regress_ssl.c
|
|
test_regress_CPPFLAGS += $(OPENSSL_INCS)
|
|
test_regress_LDADD += libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD}
|
|
endif
|
|
|
|
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
|
|
|
|
test/regress.gen.c test/regress.gen.h: test/rpcgen-attempted
|
|
|
|
test/rpcgen-attempted: test/regress.rpc event_rpcgen.py test/rpcgen_wrapper.sh
|
|
$(AM_V_GEN)date -u > $@
|
|
$(AM_V_at)if $(srcdir)/test/rpcgen_wrapper.sh $(srcdir)/test; then \
|
|
true; \
|
|
else \
|
|
echo "No Python installed; stubbing out RPC test." >&2; \
|
|
echo " "> test/regress.gen.c; \
|
|
echo "#define NO_PYTHON_EXISTS" > test/regress.gen.h; \
|
|
fi
|
|
|
|
CLEANFILES += test/rpcgen-attempted
|
|
|
|
$(TESTPROGRAMS) : libevent.la
|