blob: e106bb120eb32ccf691716ee4da5db55a6634e0b [file] [log] [blame]
Roger Meierc2cc61a2010-11-30 19:53:29 +00001#
2# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18#
Roger Meierc0959192013-01-15 23:20:19 +010019.NOTPARALLEL:
Roger Meier213a6642010-10-27 12:30:11 +000020SUBDIRS =
21
22AM_CPPFLAGS = -g -Wall -I../src $(GLIB_CFLAGS)
23AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@
24
25CFLAGS = @GCOV_CFLAGS@
26CXXFLAGS = -g
27
Roger Meier213a6642010-10-27 12:30:11 +000028check_PROGRAMS = \
Roger Meier909f1862014-07-24 23:52:14 +020029 testapplicationexception \
Roger Meier213a6642010-10-27 12:30:11 +000030 testtransportsocket \
Roger Meierc1010922010-11-26 10:17:48 +000031 testbinaryprotocol \
Roger Meier213a6642010-10-27 12:30:11 +000032 testbufferedtransport \
33 testframedtransport \
34 testmemorybuffer \
35 teststruct \
36 testsimpleserver \
37 testdebugproto \
38 testoptionalrequired \
39 testthrifttest
40
41if WITH_CPP
42 check_PROGRAMS += testthrifttestclient
43endif
44
Roger Meier909f1862014-07-24 23:52:14 +020045testapplicationexception_SOURCES = testapplicationexception.c
46testapplicationexception_LDADD = \
47 ../libthrift_c_glib_la-thrift_application_exception.o \
48 ../libthrift_c_glib_la-thrift_protocol.o \
49 ../libthrift_c_glib_la-thrift_struct.o \
50 ../libthrift_c_glib_la-thrift_transport.o
51
Roger Meier213a6642010-10-27 12:30:11 +000052testtransportsocket_SOURCES = testtransportsocket.c
53testtransportsocket_LDADD = \
54 ../libthrift_c_glib_la-thrift_transport.o \
Roger Meier63243c62014-09-29 20:29:58 +020055 ../libthrift_c_glib_la-thrift_buffered_transport.o \
Roger Meier213a6642010-10-27 12:30:11 +000056 ../libthrift_c_glib_la-thrift_server_transport.o \
57 ../libthrift_c_glib_la-thrift_server_socket.o
58
Roger Meierc1010922010-11-26 10:17:48 +000059testbinaryprotocol_SOURCES = testbinaryprotocol.c
60testbinaryprotocol_LDADD = \
Roger Meier213a6642010-10-27 12:30:11 +000061 ../libthrift_c_glib_la-thrift_protocol.o \
62 ../libthrift_c_glib_la-thrift_transport.o \
63 ../libthrift_c_glib_la-thrift_socket.o \
64 ../libthrift_c_glib_la-thrift_server_transport.o \
65 ../libthrift_c_glib_la-thrift_server_socket.o
66
67testbufferedtransport_SOURCES = testbufferedtransport.c
68testbufferedtransport_LDADD = \
69 ../libthrift_c_glib_la-thrift_transport.o \
70 ../libthrift_c_glib_la-thrift_socket.o \
71 ../libthrift_c_glib_la-thrift_server_transport.o \
72 ../libthrift_c_glib_la-thrift_server_socket.o
73
74testframedtransport_SOURCES = testframedtransport.c
75testframedtransport_LDADD = \
76 ../libthrift_c_glib_la-thrift_transport.o \
77 ../libthrift_c_glib_la-thrift_socket.o \
78 ../libthrift_c_glib_la-thrift_server_transport.o \
79 ../libthrift_c_glib_la-thrift_server_socket.o
80
81testmemorybuffer_SOURCES = testmemorybuffer.c
82testmemorybuffer_LDADD = \
83 ../libthrift_c_glib_la-thrift_transport.o
84
85teststruct_SOURCES = teststruct.c
86teststruct_LDADD = \
87 ../libthrift_c_glib_la-thrift_protocol.o \
88 ../libthrift_c_glib_la-thrift_transport.o
89
90testsimpleserver_SOURCES = testsimpleserver.c
91testsimpleserver_LDADD = \
92 ../libthrift_c_glib_la-thrift_protocol.o \
93 ../libthrift_c_glib_la-thrift_transport.o \
94 ../libthrift_c_glib_la-thrift_transport_factory.o \
95 ../libthrift_c_glib_la-thrift_processor.o \
96 ../libthrift_c_glib_la-thrift_protocol_factory.o \
97 ../libthrift_c_glib_la-thrift_binary_protocol.o \
98 ../libthrift_c_glib_la-thrift_binary_protocol_factory.o \
99 ../libthrift_c_glib_la-thrift_socket.o \
100 ../libthrift_c_glib_la-thrift_server_transport.o \
101 ../libthrift_c_glib_la-thrift_server_socket.o \
102 ../libthrift_c_glib_la-thrift_server.o
103
104testdebugproto_SOURCES = testdebugproto.c
105testdebugproto_LDADD = libtestgenc.la
106
107testoptionalrequired_SOURCES = testoptionalrequired.c
108testoptionalrequired_LDADD = \
109 ../libthrift_c_glib_la-thrift_protocol.o \
110 ../libthrift_c_glib_la-thrift_transport.o \
111 libtestgenc.la
112
113testthrifttest_SOURCES = testthrifttest.c
114testthrifttest_LDADD = libtestgenc.la
115
116testthrifttestclient_SOURCES = testthrifttestclient.cpp
117testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS)
118testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la
119testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS)
120
121check_LTLIBRARIES = libtestgenc.la
122
123if WITH_CPP
124 check_LTLIBRARIES += libtestgencpp.la
125endif
126
Bryan Duxbury39fbb9a2011-01-13 18:09:51 +0000127nodist_libtestgenc_la_SOURCES = \
Roger Meier213a6642010-10-27 12:30:11 +0000128 gen-c_glib/t_test_debug_proto_test_types.c \
129 gen-c_glib/t_test_empty_service.c \
130 gen-c_glib/t_test_inherited.c \
131 gen-c_glib/t_test_optional_required_test_types.c \
132 gen-c_glib/t_test_reverse_order_service.c \
133 gen-c_glib/t_test_second_service.c \
134 gen-c_glib/t_test_service_for_exception_with_a_map.c \
135 gen-c_glib/t_test_srv.c \
136 gen-c_glib/t_test_thrift_test.c \
137 gen-c_glib/t_test_thrift_test_types.c \
138 gen-c_glib/t_test_debug_proto_test_types.h \
139 gen-c_glib/t_test_empty_service.h \
140 gen-c_glib/t_test_inherited.h \
141 gen-c_glib/t_test_optional_required_test_types.h \
142 gen-c_glib/t_test_reverse_order_service.h \
143 gen-c_glib/t_test_second_service.h \
144 gen-c_glib/t_test_service_for_exception_with_a_map.h \
145 gen-c_glib/t_test_srv.h \
146 gen-c_glib/t_test_thrift_test.h \
147 gen-c_glib/t_test_thrift_test_types.h
148libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la
149
Bryan Duxbury39fbb9a2011-01-13 18:09:51 +0000150nodist_libtestgencpp_la_SOURCES = \
Roger Meier213a6642010-10-27 12:30:11 +0000151 gen-cpp/ThriftTest.cpp \
152 gen-cpp/ThriftTest_constants.cpp \
153 gen-cpp/ThriftTest_types.cpp \
154 gen-cpp/ThriftTest.h \
155 gen-cpp/ThriftTest_constants.h \
156 gen-cpp/ThriftTest_types.h
157libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp
158
159THRIFT = $(top_builddir)/compiler/cpp/thrift
160
161gen-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
Jens Geyeraaa89472014-10-03 20:22:28 +0200162 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000163
164gen-c_glib/t_test_optional_required_test_types.c gen-c_glib/t_test_optional_required_test_types.h: ../../../test/OptionalRequiredTest.thrift
Jens Geyeraaa89472014-10-03 20:22:28 +0200165 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000166
167gen-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
Jens Geyeraaa89472014-10-03 20:22:28 +0200168 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000169
170gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest.h: ../../../test/ThriftTest.thrift
Jens Geyeraaa89472014-10-03 20:22:28 +0200171 $(THRIFT) --gen cpp $<
Roger Meier213a6642010-10-27 12:30:11 +0000172
Roger Meier213a6642010-10-27 12:30:11 +0000173TESTS = \
Roger Meier213a6642010-10-27 12:30:11 +0000174 $(check_PROGRAMS) \
175 $(check_SCRIPTS)
176
177# globally added to all instances of valgrind calls
178# VALGRIND_OPTS = --suppressions=glib.suppress
179VALGRIND_OPTS =
180
181# globally added to all memcheck calls
182VALGRIND_MEM_OPTS = --tool=memcheck \
183 --num-callers=10 \
184 ${myextravalgrindmemopts}
185
186# globally added to all leakcheck calls
187VALGRIND_LEAK_OPTS = --tool=memcheck \
188 --num-callers=10 \
189 --leak-check=full \
190 --leak-resolution=high \
191 ${myextravalgrindleakopts}
192
193memcheck: $(check_PROGRAMS)
Jens Geyeraaa89472014-10-03 20:22:28 +0200194 @for x in $(check_PROGRAMS); \
195 do \
196 $(MAKE) memcheck-$$x; \
197 done
Roger Meier213a6642010-10-27 12:30:11 +0000198
199leakcheck: $(check_PROGRAMS)
Jens Geyeraaa89472014-10-03 20:22:28 +0200200 @for x in $(check_PROGRAMS); \
201 do \
202 $(MAKE) leakcheck-$$x; \
203 done
Roger Meier213a6642010-10-27 12:30:11 +0000204
205memcheck-%: %
Jens Geyeraaa89472014-10-03 20:22:28 +0200206 @echo "*****************************************"; \
207 echo "MEMCHECK: $<"; \
208 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_MEM_OPTS} ${$<_VALGRIND_MEM_OPTS}"; \
209 $(LIBTOOL) --mode=execute \
210 valgrind \
211 ${VALGRIND_OPTS} \
212 ${VALGRIND_MEM_OPTS} \
213 ${$<_VALGRIND_MEM_OPTS} ./$<
Roger Meier213a6642010-10-27 12:30:11 +0000214
215leakcheck-%: %
Jens Geyeraaa89472014-10-03 20:22:28 +0200216 @echo "*****************************************"; \
217 echo "LEAKCHECK: $<"; \
218 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_LEAK_OPTS} ${$<_VALGRIND_LEAK_OPTS}"; \
219 G_SLICE=always-malloc $(LIBTOOL) --mode=execute \
220 valgrind \
221 ${VALGRIND_OPTS} \
222 ${VALGRIND_LEAK_OPTS} \
223 ${$<_VALGRIND_LEAK_OPTS} ./$<
Roger Meier213a6642010-10-27 12:30:11 +0000224
Roger Meier213a6642010-10-27 12:30:11 +0000225clean-local:
Jens Geyeraaa89472014-10-03 20:22:28 +0200226 $(RM) -r gen-c_glib gen-cpp
Roger Meier213a6642010-10-27 12:30:11 +0000227
228CLEANFILES = \
Roger Meier213a6642010-10-27 12:30:11 +0000229 *.bb \
230 *.bbg \
231 *.da \
232 *.gcno \
233 *.gcda \
Roger Meierc1010922010-11-26 10:17:48 +0000234 *.gcov