blob: a8889be718773db34c19a27135b9190cae864641 [file] [log] [blame]
Roger Meier213a6642010-10-27 12:30:11 +00001SUBDIRS =
2
3AM_CPPFLAGS = -g -Wall -I../src $(GLIB_CFLAGS)
4AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@
5
6CFLAGS = @GCOV_CFLAGS@
7CXXFLAGS = -g
8
9check_SCRIPTS = \
10 testwrapper-testtransportsocket \
11 testwrapper-testprotocolbinary \
12 testwrapper-testbufferedtransport \
13 testwrapper-testframedtransport \
14 testwrapper-testmemorybuffer \
15 testwrapper-teststruct \
16 testwrapper-testsimpleserver \
17 testwrapper-testdebugproto \
18 testwrapper-testoptionalrequired \
19 testwrapper-testthrifttest
20
21if WITH_CPP
22 check_SCRIPTS += testwrapper-testthrifttestclient
23endif
24
25check_PROGRAMS = \
26 testtransportsocket \
27 testprotocolbinary \
28 testbufferedtransport \
29 testframedtransport \
30 testmemorybuffer \
31 teststruct \
32 testsimpleserver \
33 testdebugproto \
34 testoptionalrequired \
35 testthrifttest
36
37if WITH_CPP
38 check_PROGRAMS += testthrifttestclient
39endif
40
41testtransportsocket_SOURCES = testtransportsocket.c
42testtransportsocket_LDADD = \
43 ../libthrift_c_glib_la-thrift_transport.o \
44 ../libthrift_c_glib_la-thrift_server_transport.o \
45 ../libthrift_c_glib_la-thrift_server_socket.o
46
47testprotocolbinary_SOURCES = testprotocolbinary.c
48testprotocolbinary_LDADD = \
49 ../libthrift_c_glib_la-thrift_protocol.o \
50 ../libthrift_c_glib_la-thrift_transport.o \
51 ../libthrift_c_glib_la-thrift_socket.o \
52 ../libthrift_c_glib_la-thrift_server_transport.o \
53 ../libthrift_c_glib_la-thrift_server_socket.o
54
55testbufferedtransport_SOURCES = testbufferedtransport.c
56testbufferedtransport_LDADD = \
57 ../libthrift_c_glib_la-thrift_transport.o \
58 ../libthrift_c_glib_la-thrift_socket.o \
59 ../libthrift_c_glib_la-thrift_server_transport.o \
60 ../libthrift_c_glib_la-thrift_server_socket.o
61
62testframedtransport_SOURCES = testframedtransport.c
63testframedtransport_LDADD = \
64 ../libthrift_c_glib_la-thrift_transport.o \
65 ../libthrift_c_glib_la-thrift_socket.o \
66 ../libthrift_c_glib_la-thrift_server_transport.o \
67 ../libthrift_c_glib_la-thrift_server_socket.o
68
69testmemorybuffer_SOURCES = testmemorybuffer.c
70testmemorybuffer_LDADD = \
71 ../libthrift_c_glib_la-thrift_transport.o
72
73teststruct_SOURCES = teststruct.c
74teststruct_LDADD = \
75 ../libthrift_c_glib_la-thrift_protocol.o \
76 ../libthrift_c_glib_la-thrift_transport.o
77
78testsimpleserver_SOURCES = testsimpleserver.c
79testsimpleserver_LDADD = \
80 ../libthrift_c_glib_la-thrift_protocol.o \
81 ../libthrift_c_glib_la-thrift_transport.o \
82 ../libthrift_c_glib_la-thrift_transport_factory.o \
83 ../libthrift_c_glib_la-thrift_processor.o \
84 ../libthrift_c_glib_la-thrift_protocol_factory.o \
85 ../libthrift_c_glib_la-thrift_binary_protocol.o \
86 ../libthrift_c_glib_la-thrift_binary_protocol_factory.o \
87 ../libthrift_c_glib_la-thrift_socket.o \
88 ../libthrift_c_glib_la-thrift_server_transport.o \
89 ../libthrift_c_glib_la-thrift_server_socket.o \
90 ../libthrift_c_glib_la-thrift_server.o
91
92testdebugproto_SOURCES = testdebugproto.c
93testdebugproto_LDADD = libtestgenc.la
94
95testoptionalrequired_SOURCES = testoptionalrequired.c
96testoptionalrequired_LDADD = \
97 ../libthrift_c_glib_la-thrift_protocol.o \
98 ../libthrift_c_glib_la-thrift_transport.o \
99 libtestgenc.la
100
101testthrifttest_SOURCES = testthrifttest.c
102testthrifttest_LDADD = libtestgenc.la
103
104testthrifttestclient_SOURCES = testthrifttestclient.cpp
105testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS)
106testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la
107testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS)
108
109check_LTLIBRARIES = libtestgenc.la
110
111if WITH_CPP
112 check_LTLIBRARIES += libtestgencpp.la
113endif
114
115libtestgenc_la_SOURCES = \
116 gen-c_glib/t_test_debug_proto_test_types.c \
117 gen-c_glib/t_test_empty_service.c \
118 gen-c_glib/t_test_inherited.c \
119 gen-c_glib/t_test_optional_required_test_types.c \
120 gen-c_glib/t_test_reverse_order_service.c \
121 gen-c_glib/t_test_second_service.c \
122 gen-c_glib/t_test_service_for_exception_with_a_map.c \
123 gen-c_glib/t_test_srv.c \
124 gen-c_glib/t_test_thrift_test.c \
125 gen-c_glib/t_test_thrift_test_types.c \
126 gen-c_glib/t_test_debug_proto_test_types.h \
127 gen-c_glib/t_test_empty_service.h \
128 gen-c_glib/t_test_inherited.h \
129 gen-c_glib/t_test_optional_required_test_types.h \
130 gen-c_glib/t_test_reverse_order_service.h \
131 gen-c_glib/t_test_second_service.h \
132 gen-c_glib/t_test_service_for_exception_with_a_map.h \
133 gen-c_glib/t_test_srv.h \
134 gen-c_glib/t_test_thrift_test.h \
135 gen-c_glib/t_test_thrift_test_types.h
136libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la
137
138libtestgencpp_la_SOURCES = \
139 gen-cpp/ThriftTest.cpp \
140 gen-cpp/ThriftTest_constants.cpp \
141 gen-cpp/ThriftTest_types.cpp \
142 gen-cpp/ThriftTest.h \
143 gen-cpp/ThriftTest_constants.h \
144 gen-cpp/ThriftTest_types.h
145libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp
146
147THRIFT = $(top_builddir)/compiler/cpp/thrift
148
149gen-c_glib/t_test_debug_proto_test_types.c gen-c_glib/t_test_debug_proto_test_types.h gen-c_glib/t_test_empty_service.c gen-c_glib/t_test_empty_service.h gen-c_glib/t_test_inherited.c gen-c_glib/t_test_inherited.h gen-c_glib/t_test_reverse_order_service.c gen-c_glib/t_test_reverse_order_service.h gen-c_glib/t_test_service_for_exception_with_a_map.c gen-c_glib/t_test_service_for_exception_with_a_map.h gen-c_glib/t_test_srv.c gen-c_glib/t_test_srv.h: ../../../test/DebugProtoTest.thrift
150 $(THRIFT) --gen c_glib $<
151
152gen-c_glib/t_test_optional_required_test_types.c gen-c_glib/t_test_optional_required_test_types.h: ../../../test/OptionalRequiredTest.thrift
153 $(THRIFT) --gen c_glib $<
154
155gen-c_glib/t_test_second_service.c gen-c_glib/t_test_thrift_test.c gen-c_glib/t_test_thrift_test_types.c gen-c_glib/t_test_second_service.h gen-c_glib/t_test_thrift_test-.h gen-c_glib/t_test_thrift_test_types.h: ../../../test/ThriftTest.thrift
156 $(THRIFT) --gen c_glib $<
157
158gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest.h: ../../../test/ThriftTest.thrift
159 $(THRIFT) --gen cpp $<
160
161
162TESTS = \
163 $(testwrapper-%) \
164 $(check_PROGRAMS) \
165 $(check_SCRIPTS)
166
167# globally added to all instances of valgrind calls
168# VALGRIND_OPTS = --suppressions=glib.suppress
169VALGRIND_OPTS =
170
171# globally added to all memcheck calls
172VALGRIND_MEM_OPTS = --tool=memcheck \
173 --num-callers=10 \
174 ${myextravalgrindmemopts}
175
176# globally added to all leakcheck calls
177VALGRIND_LEAK_OPTS = --tool=memcheck \
178 --num-callers=10 \
179 --leak-check=full \
180 --leak-resolution=high \
181 ${myextravalgrindleakopts}
182
183memcheck: $(check_PROGRAMS)
184 @for x in $(check_PROGRAMS); \
185 do \
186 $(MAKE) memcheck-$$x; \
187 done
188
189leakcheck: $(check_PROGRAMS)
190 @for x in $(check_PROGRAMS); \
191 do \
192 $(MAKE) leakcheck-$$x; \
193 done
194
195memcheck-%: %
196 @echo "*****************************************"; \
197 echo "MEMCHECK: $<"; \
198 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_MEM_OPTS} ${$<_VALGRIND_MEM_OPTS}"; \
199 $(LIBTOOL) --mode=execute \
200 valgrind \
201 ${VALGRIND_OPTS} \
202 ${VALGRIND_MEM_OPTS} \
203 ${$<_VALGRIND_MEM_OPTS} ./$<
204
205leakcheck-%: %
206 @echo "*****************************************"; \
207 echo "LEAKCHECK: $<"; \
208 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_LEAK_OPTS} ${$<_VALGRIND_LEAK_OPTS}"; \
209 G_SLICE=always-malloc $(LIBTOOL) --mode=execute \
210 valgrind \
211 ${VALGRIND_OPTS} \
212 ${VALGRIND_LEAK_OPTS} \
213 ${$<_VALGRIND_LEAK_OPTS} ./$<
214
215testwrapper-%: % test-wrapper.sh
216 @ln -sf test-wrapper.sh $@
217
218clean-local:
219 $(RM) -r gen-c_glib gen-cpp
220
221CLEANFILES = \
222 testwrapper-* \
223 *.bb \
224 *.bbg \
225 *.da \
226 *.gcno \
227 *.gcda \
228 *.gcov \
229 test-wrapper.sh