blob: 2a3887889653349cdeca5412907ba8e1d7046f4a [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 = \
24 gen-c_glib/t_test_debug_proto_test_types.h \
25 gen-c_glib/t_test_empty_service.h \
26 gen-c_glib/t_test_inherited.h \
27 gen-c_glib/t_test_optional_required_test_types.h \
28 gen-c_glib/t_test_reverse_order_service.h \
29 gen-c_glib/t_test_second_service.h \
30 gen-c_glib/t_test_service_for_exception_with_a_map.h \
31 gen-c_glib/t_test_srv.h \
32 gen-c_glib/t_test_thrift_test.h \
33 gen-c_glib/t_test_thrift_test_types.h
34
Roger Meier213a6642010-10-27 12:30:11 +000035AM_CPPFLAGS = -g -Wall -I../src $(GLIB_CFLAGS)
36AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@
37
38CFLAGS = @GCOV_CFLAGS@
39CXXFLAGS = -g
40
Roger Meier213a6642010-10-27 12:30:11 +000041check_PROGRAMS = \
Roger Meier909f1862014-07-24 23:52:14 +020042 testapplicationexception \
Roger Meier213a6642010-10-27 12:30:11 +000043 testtransportsocket \
Roger Meierc1010922010-11-26 10:17:48 +000044 testbinaryprotocol \
Roger Meier213a6642010-10-27 12:30:11 +000045 testbufferedtransport \
46 testframedtransport \
47 testmemorybuffer \
48 teststruct \
49 testsimpleserver \
50 testdebugproto \
51 testoptionalrequired \
52 testthrifttest
53
54if WITH_CPP
Nobuaki Sukegawaef0a8fa2015-05-10 20:21:17 +090055 BUILT_SOURCES += gen-cpp/ThriftTest_types.cpp
Roger Meier213a6642010-10-27 12:30:11 +000056 check_PROGRAMS += testthrifttestclient
57endif
58
Roger Meier909f1862014-07-24 23:52:14 +020059testapplicationexception_SOURCES = testapplicationexception.c
60testapplicationexception_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +020061 $(top_builddir)/lib/c_glib/src/thrift/c_glib/libthrift_c_glib_la-thrift_application_exception.o \
62 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
63 $(top_builddir)/lib/c_glib/src/thrift/c_glib/libthrift_c_glib_la-thrift_struct.o \
64 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o
Roger Meier909f1862014-07-24 23:52:14 +020065
Roger Meier213a6642010-10-27 12:30:11 +000066testtransportsocket_SOURCES = testtransportsocket.c
67testtransportsocket_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +020068 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
69 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_buffered_transport.o \
70 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
71 $(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 +000072
Roger Meierc1010922010-11-26 10:17:48 +000073testbinaryprotocol_SOURCES = testbinaryprotocol.c
74testbinaryprotocol_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +020075 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
76 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
77 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
78 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
79 $(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 +000080
81testbufferedtransport_SOURCES = testbufferedtransport.c
82testbufferedtransport_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +020083 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
84 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
85 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
86 $(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 +000087
88testframedtransport_SOURCES = testframedtransport.c
89testframedtransport_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +020090 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
91 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
92 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
93 $(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 +000094
95testmemorybuffer_SOURCES = testmemorybuffer.c
96testmemorybuffer_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +020097 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o
Roger Meier213a6642010-10-27 12:30:11 +000098
99teststruct_SOURCES = teststruct.c
100teststruct_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200101 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
102 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o
Roger Meier213a6642010-10-27 12:30:11 +0000103
104testsimpleserver_SOURCES = testsimpleserver.c
105testsimpleserver_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200106 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
107 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
108 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport_factory.o \
109 $(top_builddir)/lib/c_glib/src/thrift/c_glib/processor/libthrift_c_glib_la-thrift_processor.o \
110 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol_factory.o \
111 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol.o \
112 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol_factory.o \
113 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
114 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
115 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o \
116 $(top_builddir)/lib/c_glib/src/thrift/c_glib/server/libthrift_c_glib_la-thrift_server.o
Roger Meier213a6642010-10-27 12:30:11 +0000117
118testdebugproto_SOURCES = testdebugproto.c
119testdebugproto_LDADD = libtestgenc.la
120
121testoptionalrequired_SOURCES = testoptionalrequired.c
122testoptionalrequired_LDADD = \
Jens Geyer86777192015-07-25 15:59:46 +0200123 $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
124 $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
Roger Meier213a6642010-10-27 12:30:11 +0000125 libtestgenc.la
126
127testthrifttest_SOURCES = testthrifttest.c
128testthrifttest_LDADD = libtestgenc.la
129
130testthrifttestclient_SOURCES = testthrifttestclient.cpp
131testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS)
132testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la
133testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS)
134
135check_LTLIBRARIES = libtestgenc.la
136
137if WITH_CPP
138 check_LTLIBRARIES += libtestgencpp.la
139endif
140
Bryan Duxbury39fbb9a2011-01-13 18:09:51 +0000141nodist_libtestgenc_la_SOURCES = \
Roger Meier213a6642010-10-27 12:30:11 +0000142 gen-c_glib/t_test_debug_proto_test_types.c \
143 gen-c_glib/t_test_empty_service.c \
144 gen-c_glib/t_test_inherited.c \
145 gen-c_glib/t_test_optional_required_test_types.c \
146 gen-c_glib/t_test_reverse_order_service.c \
147 gen-c_glib/t_test_second_service.c \
148 gen-c_glib/t_test_service_for_exception_with_a_map.c \
149 gen-c_glib/t_test_srv.c \
150 gen-c_glib/t_test_thrift_test.c \
151 gen-c_glib/t_test_thrift_test_types.c \
152 gen-c_glib/t_test_debug_proto_test_types.h \
153 gen-c_glib/t_test_empty_service.h \
154 gen-c_glib/t_test_inherited.h \
155 gen-c_glib/t_test_optional_required_test_types.h \
156 gen-c_glib/t_test_reverse_order_service.h \
157 gen-c_glib/t_test_second_service.h \
158 gen-c_glib/t_test_service_for_exception_with_a_map.h \
159 gen-c_glib/t_test_srv.h \
160 gen-c_glib/t_test_thrift_test.h \
161 gen-c_glib/t_test_thrift_test_types.h
162libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la
Jens Geyer1c190272015-07-28 23:15:18 +0200163libtestgenc_la_CPPFLAGS = $(AM_CPPFLAGS) -Wno-unused-function
Roger Meier213a6642010-10-27 12:30:11 +0000164
Bryan Duxbury39fbb9a2011-01-13 18:09:51 +0000165nodist_libtestgencpp_la_SOURCES = \
Roger Meier213a6642010-10-27 12:30:11 +0000166 gen-cpp/ThriftTest.cpp \
167 gen-cpp/ThriftTest_constants.cpp \
168 gen-cpp/ThriftTest_types.cpp \
169 gen-cpp/ThriftTest.h \
170 gen-cpp/ThriftTest_constants.h \
171 gen-cpp/ThriftTest_types.h
172libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp
173
174THRIFT = $(top_builddir)/compiler/cpp/thrift
175
176gen-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 +0200177 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000178
179gen-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 +0200180 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000181
Nobuaki Sukegawaef0a8fa2015-05-10 20:21:17 +0900182gen-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 +0200183 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000184
Roger Meier035870d2014-10-22 23:43:05 +0200185gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest_types.cpp: ../../../test/ThriftTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200186 $(THRIFT) --gen cpp $<
Roger Meier213a6642010-10-27 12:30:11 +0000187
Roger Meier213a6642010-10-27 12:30:11 +0000188TESTS = \
Roger Meier213a6642010-10-27 12:30:11 +0000189 $(check_PROGRAMS) \
190 $(check_SCRIPTS)
191
192# globally added to all instances of valgrind calls
193# VALGRIND_OPTS = --suppressions=glib.suppress
194VALGRIND_OPTS =
195
196# globally added to all memcheck calls
197VALGRIND_MEM_OPTS = --tool=memcheck \
198 --num-callers=10 \
199 ${myextravalgrindmemopts}
200
201# globally added to all leakcheck calls
202VALGRIND_LEAK_OPTS = --tool=memcheck \
203 --num-callers=10 \
204 --leak-check=full \
205 --leak-resolution=high \
206 ${myextravalgrindleakopts}
207
208memcheck: $(check_PROGRAMS)
Jens Geyer79f988c2014-10-03 20:42:54 +0200209 @for x in $(check_PROGRAMS); \
210 do \
211 $(MAKE) memcheck-$$x; \
212 done
Roger Meier213a6642010-10-27 12:30:11 +0000213
214leakcheck: $(check_PROGRAMS)
Jens Geyer79f988c2014-10-03 20:42:54 +0200215 @for x in $(check_PROGRAMS); \
216 do \
217 $(MAKE) leakcheck-$$x; \
218 done
Roger Meier213a6642010-10-27 12:30:11 +0000219
220memcheck-%: %
Jens Geyer79f988c2014-10-03 20:42:54 +0200221 @echo "*****************************************"; \
222 echo "MEMCHECK: $<"; \
223 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_MEM_OPTS} ${$<_VALGRIND_MEM_OPTS}"; \
224 $(LIBTOOL) --mode=execute \
225 valgrind \
226 ${VALGRIND_OPTS} \
227 ${VALGRIND_MEM_OPTS} \
228 ${$<_VALGRIND_MEM_OPTS} ./$<
Roger Meier213a6642010-10-27 12:30:11 +0000229
230leakcheck-%: %
Jens Geyer79f988c2014-10-03 20:42:54 +0200231 @echo "*****************************************"; \
232 echo "LEAKCHECK: $<"; \
233 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_LEAK_OPTS} ${$<_VALGRIND_LEAK_OPTS}"; \
234 G_SLICE=always-malloc $(LIBTOOL) --mode=execute \
235 valgrind \
236 ${VALGRIND_OPTS} \
237 ${VALGRIND_LEAK_OPTS} \
238 ${$<_VALGRIND_LEAK_OPTS} ./$<
Roger Meier213a6642010-10-27 12:30:11 +0000239
Roger Meier213a6642010-10-27 12:30:11 +0000240clean-local:
Jens Geyer8c5fce92015-07-28 22:59:16 +0200241 $(RM) gen-c_glib/* gen-cpp/*
Roger Meier213a6642010-10-27 12:30:11 +0000242
243CLEANFILES = \
Roger Meier213a6642010-10-27 12:30:11 +0000244 *.bb \
245 *.bbg \
246 *.da \
247 *.gcno \
248 *.gcda \
Roger Meierc1010922010-11-26 10:17:48 +0000249 *.gcov