blob: 4d35f2a1f44f31f67a60b579d11a74f6c30fa965 [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#
Jens Geyer86777192015-07-25 15:59:46 +020019AUTOMAKE_OPTIONS = subdir-objects serial-tests
Roger Meier81a1f992014-10-22 14:09:43 +020020
Roger Meier213a6642010-10-27 12:30:11 +000021SUBDIRS =
22
Nobuaki Sukegawaef0a8fa2015-05-10 20:21:17 +090023BUILT_SOURCES = \
Jens Geyer54f392b2015-08-05 21:45:10 +020024 gen-c_glib/t_test_container_test_types.c \
25 gen-c_glib/t_test_container_test_types.h \
Nobuaki Sukegawaef0a8fa2015-05-10 20:21:17 +090026 gen-c_glib/t_test_debug_proto_test_types.h \
27 gen-c_glib/t_test_empty_service.h \
28 gen-c_glib/t_test_inherited.h \
29 gen-c_glib/t_test_optional_required_test_types.h \
30 gen-c_glib/t_test_reverse_order_service.h \
31 gen-c_glib/t_test_second_service.h \
32 gen-c_glib/t_test_service_for_exception_with_a_map.h \
Jens Geyer54f392b2015-08-05 21:45:10 +020033 gen-c_glib/t_test_container_service.c \
34 gen-c_glib/t_test_container_service.h \
Nobuaki Sukegawaef0a8fa2015-05-10 20:21:17 +090035 gen-c_glib/t_test_srv.h \
36 gen-c_glib/t_test_thrift_test.h \
37 gen-c_glib/t_test_thrift_test_types.h
38
Simon Southdb3646f2015-08-01 12:18:12 +000039AM_CPPFLAGS = -I../src
40AM_CFLAGS = -g -Wall -Wextra -pedantic $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) \
41 @GCOV_CFLAGS@
42AM_CXXFLAGS = $(AM_CFLAGS)
Roger Meier213a6642010-10-27 12:30:11 +000043AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@
44
Roger Meier213a6642010-10-27 12:30:11 +000045check_PROGRAMS = \
Nobuaki Sukegawa362a5ed2015-12-01 22:17:24 +090046 testserialization \
Roger Meier909f1862014-07-24 23:52:14 +020047 testapplicationexception \
Jens Geyer54f392b2015-08-05 21:45:10 +020048 testcontainertest \
Roger Meier213a6642010-10-27 12:30:11 +000049 testtransportsocket \
Roger Meierc1010922010-11-26 10:17:48 +000050 testbinaryprotocol \
Roger Meier213a6642010-10-27 12:30:11 +000051 testbufferedtransport \
52 testframedtransport \
53 testmemorybuffer \
54 teststruct \
55 testsimpleserver \
56 testdebugproto \
57 testoptionalrequired \
58 testthrifttest
59
60if WITH_CPP
Nobuaki Sukegawaef0a8fa2015-05-10 20:21:17 +090061 BUILT_SOURCES += gen-cpp/ThriftTest_types.cpp
Roger Meier213a6642010-10-27 12:30:11 +000062 check_PROGRAMS += testthrifttestclient
63endif
64
Nobuaki Sukegawa362a5ed2015-12-01 22:17:24 +090065testserialization_SOURCES = testserialization.c
66testserialization_LDADD = \
67 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
68 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
69 libtestgenc.la
70
Roger Meier909f1862014-07-24 23:52:14 +020071testapplicationexception_SOURCES = testapplicationexception.c
72testapplicationexception_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +020073 $(top_builddir)/lib/c_glib/src/thrift/c_glib/libthrift_c_glib_la-thrift_application_exception.o \
74 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
75 $(top_builddir)/lib/c_glib/src/thrift/c_glib/libthrift_c_glib_la-thrift_struct.o \
76 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o
Roger Meier909f1862014-07-24 23:52:14 +020077
Jens Geyer54f392b2015-08-05 21:45:10 +020078testcontainertest_SOURCES = testcontainertest.c
79testcontainertest_LDADD = \
80 $(top_builddir)/lib/c_glib/src/thrift/c_glib/libthrift_c_glib_la-thrift_struct.o \
81 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
82 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
83 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport_factory.o \
84 $(top_builddir)/lib/c_glib/src/thrift/c_glib/processor/libthrift_c_glib_la-thrift_processor.o \
85 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol_factory.o \
86 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol.o \
87 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol_factory.o \
88 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
89 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
90 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o \
91 $(top_builddir)/lib/c_glib/src/thrift/c_glib/server/libthrift_c_glib_la-thrift_server.o \
92 libtestgenc.la
93
Roger Meier213a6642010-10-27 12:30:11 +000094testtransportsocket_SOURCES = testtransportsocket.c
95testtransportsocket_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +020096 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
97 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_buffered_transport.o \
98 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
99 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o
Roger Meier213a6642010-10-27 12:30:11 +0000100
Roger Meierc1010922010-11-26 10:17:48 +0000101testbinaryprotocol_SOURCES = testbinaryprotocol.c
102testbinaryprotocol_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200103 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
104 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
105 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
106 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
107 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o
Roger Meier213a6642010-10-27 12:30:11 +0000108
109testbufferedtransport_SOURCES = testbufferedtransport.c
110testbufferedtransport_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200111 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
112 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
113 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
114 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o
Roger Meier213a6642010-10-27 12:30:11 +0000115
116testframedtransport_SOURCES = testframedtransport.c
117testframedtransport_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200118 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
119 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
120 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
121 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o
Roger Meier213a6642010-10-27 12:30:11 +0000122
123testmemorybuffer_SOURCES = testmemorybuffer.c
124testmemorybuffer_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200125 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o
Roger Meier213a6642010-10-27 12:30:11 +0000126
127teststruct_SOURCES = teststruct.c
128teststruct_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200129 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
130 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o
Roger Meier213a6642010-10-27 12:30:11 +0000131
132testsimpleserver_SOURCES = testsimpleserver.c
133testsimpleserver_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200134 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
135 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
136 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport_factory.o \
137 $(top_builddir)/lib/c_glib/src/thrift/c_glib/processor/libthrift_c_glib_la-thrift_processor.o \
138 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol_factory.o \
139 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol.o \
140 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol_factory.o \
141 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
142 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
143 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o \
144 $(top_builddir)/lib/c_glib/src/thrift/c_glib/server/libthrift_c_glib_la-thrift_server.o
Roger Meier213a6642010-10-27 12:30:11 +0000145
146testdebugproto_SOURCES = testdebugproto.c
147testdebugproto_LDADD = libtestgenc.la
148
149testoptionalrequired_SOURCES = testoptionalrequired.c
150testoptionalrequired_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200151 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
152 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
Roger Meier213a6642010-10-27 12:30:11 +0000153 libtestgenc.la
154
155testthrifttest_SOURCES = testthrifttest.c
156testthrifttest_LDADD = libtestgenc.la
157
158testthrifttestclient_SOURCES = testthrifttestclient.cpp
159testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS)
160testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la
161testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS)
162
163check_LTLIBRARIES = libtestgenc.la
164
165if WITH_CPP
166 check_LTLIBRARIES += libtestgencpp.la
167endif
168
Bryan Duxbury39fbb9a2011-01-13 18:09:51 +0000169nodist_libtestgenc_la_SOURCES = \
Jens Geyer54f392b2015-08-05 21:45:10 +0200170 gen-c_glib/t_test_container_test_types.c \
Roger Meier213a6642010-10-27 12:30:11 +0000171 gen-c_glib/t_test_debug_proto_test_types.c \
Nobuaki Sukegawaba3fe862015-12-01 22:42:55 +0900172 gen-c_glib/t_test_enum_test_types.c \
173 gen-c_glib/t_test_enum_test_service.c \
Roger Meier213a6642010-10-27 12:30:11 +0000174 gen-c_glib/t_test_empty_service.c \
175 gen-c_glib/t_test_inherited.c \
176 gen-c_glib/t_test_optional_required_test_types.c \
177 gen-c_glib/t_test_reverse_order_service.c \
178 gen-c_glib/t_test_second_service.c \
179 gen-c_glib/t_test_service_for_exception_with_a_map.c \
180 gen-c_glib/t_test_srv.c \
Jens Geyer54f392b2015-08-05 21:45:10 +0200181 gen-c_glib/t_test_container_service.c \
Roger Meier213a6642010-10-27 12:30:11 +0000182 gen-c_glib/t_test_thrift_test.c \
183 gen-c_glib/t_test_thrift_test_types.c \
Jens Geyer54f392b2015-08-05 21:45:10 +0200184 gen-c_glib/t_test_container_test_types.h \
Roger Meier213a6642010-10-27 12:30:11 +0000185 gen-c_glib/t_test_debug_proto_test_types.h \
Nobuaki Sukegawaba3fe862015-12-01 22:42:55 +0900186 gen-c_glib/t_test_enum_test_types.h \
187 gen-c_glib/t_test_enum_test_service.h \
Roger Meier213a6642010-10-27 12:30:11 +0000188 gen-c_glib/t_test_empty_service.h \
189 gen-c_glib/t_test_inherited.h \
190 gen-c_glib/t_test_optional_required_test_types.h \
191 gen-c_glib/t_test_reverse_order_service.h \
192 gen-c_glib/t_test_second_service.h \
193 gen-c_glib/t_test_service_for_exception_with_a_map.h \
194 gen-c_glib/t_test_srv.h \
Jens Geyer54f392b2015-08-05 21:45:10 +0200195 gen-c_glib/t_test_container_service.h \
Roger Meier213a6642010-10-27 12:30:11 +0000196 gen-c_glib/t_test_thrift_test.h \
197 gen-c_glib/t_test_thrift_test_types.h
198libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la
Jens Geyer1c190272015-07-28 23:15:18 +0200199libtestgenc_la_CPPFLAGS = $(AM_CPPFLAGS) -Wno-unused-function
Roger Meier213a6642010-10-27 12:30:11 +0000200
Bryan Duxbury39fbb9a2011-01-13 18:09:51 +0000201nodist_libtestgencpp_la_SOURCES = \
Roger Meier213a6642010-10-27 12:30:11 +0000202 gen-cpp/ThriftTest.cpp \
203 gen-cpp/ThriftTest_constants.cpp \
204 gen-cpp/ThriftTest_types.cpp \
205 gen-cpp/ThriftTest.h \
206 gen-cpp/ThriftTest_constants.h \
207 gen-cpp/ThriftTest_types.h
208libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp
209
210THRIFT = $(top_builddir)/compiler/cpp/thrift
211
Jens Geyer54f392b2015-08-05 21:45:10 +0200212gen-c_glib/t_test_container_test_types.c gen-c_glib/t_test_container_test_types.h gen-c_glib/t_test_container_service.c gen-c_glib/t_test_container_service.h: ContainerTest.thrift
213 $(THRIFT) --gen c_glib $<
214
Roger Meier213a6642010-10-27 12:30:11 +0000215gen-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 Geyer79f988c2014-10-03 20:42:54 +0200216 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000217
Nobuaki Sukegawaba3fe862015-12-01 22:42:55 +0900218gen-c_glib/t_test_enum_test_types.c gen-c_glib/t_test_enum_test_types.h gen-c_glib/t_test_enum_test_service.c gen-c_glib/t_test_enum_test_service.h : ../../../test/EnumTest.thrift
219 $(THRIFT) --gen c_glib $<
220
Roger Meier213a6642010-10-27 12:30:11 +0000221gen-c_glib/t_test_optional_required_test_types.c gen-c_glib/t_test_optional_required_test_types.h: ../../../test/OptionalRequiredTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200222 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000223
Nobuaki Sukegawaef0a8fa2015-05-10 20:21:17 +0900224gen-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 Geyer79f988c2014-10-03 20:42:54 +0200225 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000226
Roger Meier035870d2014-10-22 23:43:05 +0200227gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest_types.cpp: ../../../test/ThriftTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200228 $(THRIFT) --gen cpp $<
Roger Meier213a6642010-10-27 12:30:11 +0000229
Roger Meier213a6642010-10-27 12:30:11 +0000230TESTS = \
Roger Meier213a6642010-10-27 12:30:11 +0000231 $(check_PROGRAMS) \
232 $(check_SCRIPTS)
233
234# globally added to all instances of valgrind calls
235# VALGRIND_OPTS = --suppressions=glib.suppress
236VALGRIND_OPTS =
237
238# globally added to all memcheck calls
239VALGRIND_MEM_OPTS = --tool=memcheck \
240 --num-callers=10 \
241 ${myextravalgrindmemopts}
242
243# globally added to all leakcheck calls
244VALGRIND_LEAK_OPTS = --tool=memcheck \
245 --num-callers=10 \
246 --leak-check=full \
247 --leak-resolution=high \
248 ${myextravalgrindleakopts}
249
250memcheck: $(check_PROGRAMS)
Jens Geyer79f988c2014-10-03 20:42:54 +0200251 @for x in $(check_PROGRAMS); \
252 do \
253 $(MAKE) memcheck-$$x; \
254 done
Roger Meier213a6642010-10-27 12:30:11 +0000255
256leakcheck: $(check_PROGRAMS)
Jens Geyer79f988c2014-10-03 20:42:54 +0200257 @for x in $(check_PROGRAMS); \
258 do \
259 $(MAKE) leakcheck-$$x; \
260 done
Roger Meier213a6642010-10-27 12:30:11 +0000261
262memcheck-%: %
Jens Geyer79f988c2014-10-03 20:42:54 +0200263 @echo "*****************************************"; \
264 echo "MEMCHECK: $<"; \
265 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_MEM_OPTS} ${$<_VALGRIND_MEM_OPTS}"; \
266 $(LIBTOOL) --mode=execute \
267 valgrind \
268 ${VALGRIND_OPTS} \
269 ${VALGRIND_MEM_OPTS} \
270 ${$<_VALGRIND_MEM_OPTS} ./$<
Roger Meier213a6642010-10-27 12:30:11 +0000271
272leakcheck-%: %
Jens Geyer79f988c2014-10-03 20:42:54 +0200273 @echo "*****************************************"; \
274 echo "LEAKCHECK: $<"; \
275 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_LEAK_OPTS} ${$<_VALGRIND_LEAK_OPTS}"; \
276 G_SLICE=always-malloc $(LIBTOOL) --mode=execute \
277 valgrind \
278 ${VALGRIND_OPTS} \
279 ${VALGRIND_LEAK_OPTS} \
280 ${$<_VALGRIND_LEAK_OPTS} ./$<
Roger Meier213a6642010-10-27 12:30:11 +0000281
Roger Meier213a6642010-10-27 12:30:11 +0000282clean-local:
Jens Geyer8c5fce92015-07-28 22:59:16 +0200283 $(RM) gen-c_glib/* gen-cpp/*
Roger Meier213a6642010-10-27 12:30:11 +0000284
285CLEANFILES = \
Roger Meier213a6642010-10-27 12:30:11 +0000286 *.bb \
287 *.bbg \
288 *.da \
289 *.gcno \
290 *.gcda \
Roger Meierc1010922010-11-26 10:17:48 +0000291 *.gcov
jfarrellf13e4312015-08-25 00:39:29 -0400292
293EXTRA_DIST = \
294 CMakeLists.txt \
295 ContainerTest.thrift
296