blob: 7319743e779fe788500f43159840558ee72fbf8d [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 = \
Roger Meier909f1862014-07-24 23:52:14 +020046 testapplicationexception \
Jens Geyer54f392b2015-08-05 21:45:10 +020047 testcontainertest \
Roger Meier213a6642010-10-27 12:30:11 +000048 testtransportsocket \
Roger Meierc1010922010-11-26 10:17:48 +000049 testbinaryprotocol \
Roger Meier213a6642010-10-27 12:30:11 +000050 testbufferedtransport \
51 testframedtransport \
52 testmemorybuffer \
53 teststruct \
54 testsimpleserver \
55 testdebugproto \
56 testoptionalrequired \
57 testthrifttest
58
59if WITH_CPP
Nobuaki Sukegawaef0a8fa2015-05-10 20:21:17 +090060 BUILT_SOURCES += gen-cpp/ThriftTest_types.cpp
Roger Meier213a6642010-10-27 12:30:11 +000061 check_PROGRAMS += testthrifttestclient
62endif
63
Roger Meier909f1862014-07-24 23:52:14 +020064testapplicationexception_SOURCES = testapplicationexception.c
65testapplicationexception_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +020066 $(top_builddir)/lib/c_glib/src/thrift/c_glib/libthrift_c_glib_la-thrift_application_exception.o \
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/libthrift_c_glib_la-thrift_struct.o \
69 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o
Roger Meier909f1862014-07-24 23:52:14 +020070
Jens Geyer54f392b2015-08-05 21:45:10 +020071testcontainertest_SOURCES = testcontainertest.c
72testcontainertest_LDADD = \
73 $(top_builddir)/lib/c_glib/src/thrift/c_glib/libthrift_c_glib_la-thrift_struct.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/transport/libthrift_c_glib_la-thrift_transport.o \
76 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport_factory.o \
77 $(top_builddir)/lib/c_glib/src/thrift/c_glib/processor/libthrift_c_glib_la-thrift_processor.o \
78 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol_factory.o \
79 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol.o \
80 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol_factory.o \
81 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
82 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
83 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o \
84 $(top_builddir)/lib/c_glib/src/thrift/c_glib/server/libthrift_c_glib_la-thrift_server.o \
85 libtestgenc.la
86
Roger Meier213a6642010-10-27 12:30:11 +000087testtransportsocket_SOURCES = testtransportsocket.c
88testtransportsocket_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +020089 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
90 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_buffered_transport.o \
91 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
92 $(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 +000093
Roger Meierc1010922010-11-26 10:17:48 +000094testbinaryprotocol_SOURCES = testbinaryprotocol.c
95testbinaryprotocol_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +020096 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
97 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
98 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
99 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
100 $(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 +0000101
102testbufferedtransport_SOURCES = testbufferedtransport.c
103testbufferedtransport_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200104 $(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
109testframedtransport_SOURCES = testframedtransport.c
110testframedtransport_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
116testmemorybuffer_SOURCES = testmemorybuffer.c
117testmemorybuffer_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
Roger Meier213a6642010-10-27 12:30:11 +0000119
120teststruct_SOURCES = teststruct.c
121teststruct_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200122 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
123 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o
Roger Meier213a6642010-10-27 12:30:11 +0000124
125testsimpleserver_SOURCES = testsimpleserver.c
126testsimpleserver_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200127 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
128 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
129 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport_factory.o \
130 $(top_builddir)/lib/c_glib/src/thrift/c_glib/processor/libthrift_c_glib_la-thrift_processor.o \
131 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol_factory.o \
132 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol.o \
133 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol_factory.o \
134 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
135 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
136 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o \
137 $(top_builddir)/lib/c_glib/src/thrift/c_glib/server/libthrift_c_glib_la-thrift_server.o
Roger Meier213a6642010-10-27 12:30:11 +0000138
139testdebugproto_SOURCES = testdebugproto.c
140testdebugproto_LDADD = libtestgenc.la
141
142testoptionalrequired_SOURCES = testoptionalrequired.c
143testoptionalrequired_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200144 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
145 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
Roger Meier213a6642010-10-27 12:30:11 +0000146 libtestgenc.la
147
148testthrifttest_SOURCES = testthrifttest.c
149testthrifttest_LDADD = libtestgenc.la
150
151testthrifttestclient_SOURCES = testthrifttestclient.cpp
152testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS)
153testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la
154testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS)
155
156check_LTLIBRARIES = libtestgenc.la
157
158if WITH_CPP
159 check_LTLIBRARIES += libtestgencpp.la
160endif
161
Bryan Duxbury39fbb9a2011-01-13 18:09:51 +0000162nodist_libtestgenc_la_SOURCES = \
Jens Geyer54f392b2015-08-05 21:45:10 +0200163 gen-c_glib/t_test_container_test_types.c \
Roger Meier213a6642010-10-27 12:30:11 +0000164 gen-c_glib/t_test_debug_proto_test_types.c \
165 gen-c_glib/t_test_empty_service.c \
166 gen-c_glib/t_test_inherited.c \
167 gen-c_glib/t_test_optional_required_test_types.c \
168 gen-c_glib/t_test_reverse_order_service.c \
169 gen-c_glib/t_test_second_service.c \
170 gen-c_glib/t_test_service_for_exception_with_a_map.c \
171 gen-c_glib/t_test_srv.c \
Jens Geyer54f392b2015-08-05 21:45:10 +0200172 gen-c_glib/t_test_container_service.c \
Roger Meier213a6642010-10-27 12:30:11 +0000173 gen-c_glib/t_test_thrift_test.c \
174 gen-c_glib/t_test_thrift_test_types.c \
Jens Geyer54f392b2015-08-05 21:45:10 +0200175 gen-c_glib/t_test_container_test_types.h \
Roger Meier213a6642010-10-27 12:30:11 +0000176 gen-c_glib/t_test_debug_proto_test_types.h \
177 gen-c_glib/t_test_empty_service.h \
178 gen-c_glib/t_test_inherited.h \
179 gen-c_glib/t_test_optional_required_test_types.h \
180 gen-c_glib/t_test_reverse_order_service.h \
181 gen-c_glib/t_test_second_service.h \
182 gen-c_glib/t_test_service_for_exception_with_a_map.h \
183 gen-c_glib/t_test_srv.h \
Jens Geyer54f392b2015-08-05 21:45:10 +0200184 gen-c_glib/t_test_container_service.h \
Roger Meier213a6642010-10-27 12:30:11 +0000185 gen-c_glib/t_test_thrift_test.h \
186 gen-c_glib/t_test_thrift_test_types.h
187libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la
Jens Geyer1c190272015-07-28 23:15:18 +0200188libtestgenc_la_CPPFLAGS = $(AM_CPPFLAGS) -Wno-unused-function
Roger Meier213a6642010-10-27 12:30:11 +0000189
Bryan Duxbury39fbb9a2011-01-13 18:09:51 +0000190nodist_libtestgencpp_la_SOURCES = \
Roger Meier213a6642010-10-27 12:30:11 +0000191 gen-cpp/ThriftTest.cpp \
192 gen-cpp/ThriftTest_constants.cpp \
193 gen-cpp/ThriftTest_types.cpp \
194 gen-cpp/ThriftTest.h \
195 gen-cpp/ThriftTest_constants.h \
196 gen-cpp/ThriftTest_types.h
197libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp
198
199THRIFT = $(top_builddir)/compiler/cpp/thrift
200
Jens Geyer54f392b2015-08-05 21:45:10 +0200201gen-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
202 $(THRIFT) --gen c_glib $<
203
Roger Meier213a6642010-10-27 12:30:11 +0000204gen-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 +0200205 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000206
207gen-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 +0200208 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000209
Nobuaki Sukegawaef0a8fa2015-05-10 20:21:17 +0900210gen-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 +0200211 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000212
Roger Meier035870d2014-10-22 23:43:05 +0200213gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest_types.cpp: ../../../test/ThriftTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200214 $(THRIFT) --gen cpp $<
Roger Meier213a6642010-10-27 12:30:11 +0000215
Roger Meier213a6642010-10-27 12:30:11 +0000216TESTS = \
Roger Meier213a6642010-10-27 12:30:11 +0000217 $(check_PROGRAMS) \
218 $(check_SCRIPTS)
219
220# globally added to all instances of valgrind calls
221# VALGRIND_OPTS = --suppressions=glib.suppress
222VALGRIND_OPTS =
223
224# globally added to all memcheck calls
225VALGRIND_MEM_OPTS = --tool=memcheck \
226 --num-callers=10 \
227 ${myextravalgrindmemopts}
228
229# globally added to all leakcheck calls
230VALGRIND_LEAK_OPTS = --tool=memcheck \
231 --num-callers=10 \
232 --leak-check=full \
233 --leak-resolution=high \
234 ${myextravalgrindleakopts}
235
236memcheck: $(check_PROGRAMS)
Jens Geyer79f988c2014-10-03 20:42:54 +0200237 @for x in $(check_PROGRAMS); \
238 do \
239 $(MAKE) memcheck-$$x; \
240 done
Roger Meier213a6642010-10-27 12:30:11 +0000241
242leakcheck: $(check_PROGRAMS)
Jens Geyer79f988c2014-10-03 20:42:54 +0200243 @for x in $(check_PROGRAMS); \
244 do \
245 $(MAKE) leakcheck-$$x; \
246 done
Roger Meier213a6642010-10-27 12:30:11 +0000247
248memcheck-%: %
Jens Geyer79f988c2014-10-03 20:42:54 +0200249 @echo "*****************************************"; \
250 echo "MEMCHECK: $<"; \
251 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_MEM_OPTS} ${$<_VALGRIND_MEM_OPTS}"; \
252 $(LIBTOOL) --mode=execute \
253 valgrind \
254 ${VALGRIND_OPTS} \
255 ${VALGRIND_MEM_OPTS} \
256 ${$<_VALGRIND_MEM_OPTS} ./$<
Roger Meier213a6642010-10-27 12:30:11 +0000257
258leakcheck-%: %
Jens Geyer79f988c2014-10-03 20:42:54 +0200259 @echo "*****************************************"; \
260 echo "LEAKCHECK: $<"; \
261 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_LEAK_OPTS} ${$<_VALGRIND_LEAK_OPTS}"; \
262 G_SLICE=always-malloc $(LIBTOOL) --mode=execute \
263 valgrind \
264 ${VALGRIND_OPTS} \
265 ${VALGRIND_LEAK_OPTS} \
266 ${$<_VALGRIND_LEAK_OPTS} ./$<
Roger Meier213a6642010-10-27 12:30:11 +0000267
Roger Meier213a6642010-10-27 12:30:11 +0000268clean-local:
Jens Geyer8c5fce92015-07-28 22:59:16 +0200269 $(RM) gen-c_glib/* gen-cpp/*
Roger Meier213a6642010-10-27 12:30:11 +0000270
271CLEANFILES = \
Roger Meier213a6642010-10-27 12:30:11 +0000272 *.bb \
273 *.bbg \
274 *.da \
275 *.gcno \
276 *.gcda \
Roger Meierc1010922010-11-26 10:17:48 +0000277 *.gcov
jfarrellf13e4312015-08-25 00:39:29 -0400278
279EXTRA_DIST = \
280 CMakeLists.txt \
281 ContainerTest.thrift
282