summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Makefile.am8
-rw-r--r--test/Makefile.nmake5
-rw-r--r--test/regress_rpc.c9
3 files changed, 21 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index b867501f..0374d81e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -72,7 +72,13 @@ bench_httpclient_SOURCES = bench_httpclient.c
bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) ../libevent_core.la
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 = *~
diff --git a/test/Makefile.nmake b/test/Makefile.nmake
index e361d655..6f37db9b 100644
--- a/test/Makefile.nmake
+++ b/test/Makefile.nmake
@@ -50,6 +50,11 @@ bench_http.exe: bench_http.obj
bench_httpclient.exe: 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:
-del $(REGRESS_OBJS)
-del $(OTHER_OBJS)
diff --git a/test/regress_rpc.c b/test/regress_rpc.c
index d9d59ec0..530b6bf4 100644
--- a/test/regress_rpc.c
+++ b/test/regress_rpc.c
@@ -71,6 +71,8 @@
#include "regress.h"
#include "regress_testutils.h"
+#ifndef NO_PYTHON_EXISTS
+
static struct evhttp *
http_setup(ev_uint16_t *pport)
{
@@ -870,6 +872,13 @@ end:
{ #name, run_legacy_test_fn, TT_FORK|TT_NEED_BASE|TT_LEGACY, \
&legacy_setup, \
rpc_##name }
+#else
+/* NO_PYTHON_EXISTS */
+
+#define RPC_LEGACY(name) \
+ { #name, NULL, TT_SKIP, NULL, NULL }
+
+#endif
struct testcase_t rpc_testcases[] = {
RPC_LEGACY(basic_test),