Merge remote-tracking branch 'origin/patches-2.0'

This commit is contained in:
Nick Mathewson 2011-06-14 15:15:43 -04:00
commit 33124033fd
3 changed files with 21 additions and 1 deletions

View File

@ -72,7 +72,13 @@ bench_httpclient_SOURCES = bench_httpclient.c
bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) ../libevent_core.la bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) ../libevent_core.la
regress.gen.c regress.gen.h: regress.rpc $(top_srcdir)/event_rpcgen.py regress.gen.c regress.gen.h: regress.rpc $(top_srcdir)/event_rpcgen.py
$(top_srcdir)/event_rpcgen.py $(srcdir)/regress.rpc || echo "No Python installed" if $(top_srcdir)/event_rpcgen.py $(srcdir)/regress.rpc ; then \
echo "HI"; \
else \
echo "No Python installed; can't test RPC."; \
echo ""> regress.gen.c; \
echo "#define NO_PYTHON_EXISTS" > regress.gen.h; \
fi
DISTCLEANFILES = *~ DISTCLEANFILES = *~

View File

@ -50,6 +50,11 @@ bench_http.exe: bench_http.obj
bench_httpclient.exe: bench_httpclient.obj bench_httpclient.exe: bench_httpclient.obj
$(CC) $(CFLAGS) $(LIBS) bench_httpclient.obj $(CC) $(CFLAGS) $(LIBS) bench_httpclient.obj
regress.gen.c regress.gen.h: regress.rpc ../event_rpcgen.py
echo // > regress.gen.c
echo #define NO_PYTHON_EXISTS > regress.gen.h
-python ..\event_rpcgen.py regress.rpc
clean: clean:
-del $(REGRESS_OBJS) -del $(REGRESS_OBJS)
-del $(OTHER_OBJS) -del $(OTHER_OBJS)

View File

@ -71,6 +71,8 @@
#include "regress.h" #include "regress.h"
#include "regress_testutils.h" #include "regress_testutils.h"
#ifndef NO_PYTHON_EXISTS
static struct evhttp * static struct evhttp *
http_setup(ev_uint16_t *pport) http_setup(ev_uint16_t *pport)
{ {
@ -870,6 +872,13 @@ end:
{ #name, run_legacy_test_fn, TT_FORK|TT_NEED_BASE|TT_LEGACY, \ { #name, run_legacy_test_fn, TT_FORK|TT_NEED_BASE|TT_LEGACY, \
&legacy_setup, \ &legacy_setup, \
rpc_##name } rpc_##name }
#else
/* NO_PYTHON_EXISTS */
#define RPC_LEGACY(name) \
{ #name, NULL, TT_SKIP, NULL, NULL }
#endif
struct testcase_t rpc_testcases[] = { struct testcase_t rpc_testcases[] = {
RPC_LEGACY(basic_test), RPC_LEGACY(basic_test),