blob: 46837592450dd6613bcc89ce684515a382eb2e82 [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 Meier81a1f992014-10-22 14:09:43 +020019AUTOMAKE_OPTIONS = serial-tests
20
Roger Meier213a6642010-10-27 12:30:11 +000021SUBDIRS =
22
23AM_CPPFLAGS = -g -Wall -I../src $(GLIB_CFLAGS)
24AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@
25
26CFLAGS = @GCOV_CFLAGS@
27CXXFLAGS = -g
28
Roger Meier213a6642010-10-27 12:30:11 +000029check_PROGRAMS = \
Roger Meier909f1862014-07-24 23:52:14 +020030 testapplicationexception \
Roger Meier213a6642010-10-27 12:30:11 +000031 testtransportsocket \
Roger Meierc1010922010-11-26 10:17:48 +000032 testbinaryprotocol \
Roger Meier213a6642010-10-27 12:30:11 +000033 testbufferedtransport \
34 testframedtransport \
35 testmemorybuffer \
36 teststruct \
37 testsimpleserver \
38 testdebugproto \
39 testoptionalrequired \
40 testthrifttest
41
42if WITH_CPP
43 check_PROGRAMS += testthrifttestclient
44endif
45
Roger Meier909f1862014-07-24 23:52:14 +020046testapplicationexception_SOURCES = testapplicationexception.c
47testapplicationexception_LDADD = \
48 ../libthrift_c_glib_la-thrift_application_exception.o \
49 ../libthrift_c_glib_la-thrift_protocol.o \
50 ../libthrift_c_glib_la-thrift_struct.o \
51 ../libthrift_c_glib_la-thrift_transport.o
52
Roger Meier213a6642010-10-27 12:30:11 +000053testtransportsocket_SOURCES = testtransportsocket.c
54testtransportsocket_LDADD = \
55 ../libthrift_c_glib_la-thrift_transport.o \
Roger Meier63243c62014-09-29 20:29:58 +020056 ../libthrift_c_glib_la-thrift_buffered_transport.o \
Roger Meier213a6642010-10-27 12:30:11 +000057 ../libthrift_c_glib_la-thrift_server_transport.o \
58 ../libthrift_c_glib_la-thrift_server_socket.o
59
Roger Meierc1010922010-11-26 10:17:48 +000060testbinaryprotocol_SOURCES = testbinaryprotocol.c
61testbinaryprotocol_LDADD = \
Roger Meier213a6642010-10-27 12:30:11 +000062 ../libthrift_c_glib_la-thrift_protocol.o \
63 ../libthrift_c_glib_la-thrift_transport.o \
64 ../libthrift_c_glib_la-thrift_socket.o \
65 ../libthrift_c_glib_la-thrift_server_transport.o \
66 ../libthrift_c_glib_la-thrift_server_socket.o
67
68testbufferedtransport_SOURCES = testbufferedtransport.c
69testbufferedtransport_LDADD = \
70 ../libthrift_c_glib_la-thrift_transport.o \
71 ../libthrift_c_glib_la-thrift_socket.o \
72 ../libthrift_c_glib_la-thrift_server_transport.o \
73 ../libthrift_c_glib_la-thrift_server_socket.o
74
75testframedtransport_SOURCES = testframedtransport.c
76testframedtransport_LDADD = \
77 ../libthrift_c_glib_la-thrift_transport.o \
78 ../libthrift_c_glib_la-thrift_socket.o \
79 ../libthrift_c_glib_la-thrift_server_transport.o \
80 ../libthrift_c_glib_la-thrift_server_socket.o
81
82testmemorybuffer_SOURCES = testmemorybuffer.c
83testmemorybuffer_LDADD = \
84 ../libthrift_c_glib_la-thrift_transport.o
85
86teststruct_SOURCES = teststruct.c
87teststruct_LDADD = \
88 ../libthrift_c_glib_la-thrift_protocol.o \
89 ../libthrift_c_glib_la-thrift_transport.o
90
91testsimpleserver_SOURCES = testsimpleserver.c
92testsimpleserver_LDADD = \
93 ../libthrift_c_glib_la-thrift_protocol.o \
94 ../libthrift_c_glib_la-thrift_transport.o \
95 ../libthrift_c_glib_la-thrift_transport_factory.o \
96 ../libthrift_c_glib_la-thrift_processor.o \
97 ../libthrift_c_glib_la-thrift_protocol_factory.o \
98 ../libthrift_c_glib_la-thrift_binary_protocol.o \
99 ../libthrift_c_glib_la-thrift_binary_protocol_factory.o \
100 ../libthrift_c_glib_la-thrift_socket.o \
101 ../libthrift_c_glib_la-thrift_server_transport.o \
102 ../libthrift_c_glib_la-thrift_server_socket.o \
103 ../libthrift_c_glib_la-thrift_server.o
104
105testdebugproto_SOURCES = testdebugproto.c
106testdebugproto_LDADD = libtestgenc.la
107
108testoptionalrequired_SOURCES = testoptionalrequired.c
109testoptionalrequired_LDADD = \
110 ../libthrift_c_glib_la-thrift_protocol.o \
111 ../libthrift_c_glib_la-thrift_transport.o \
112 libtestgenc.la
113
114testthrifttest_SOURCES = testthrifttest.c
115testthrifttest_LDADD = libtestgenc.la
116
117testthrifttestclient_SOURCES = testthrifttestclient.cpp
118testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS)
119testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la
120testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS)
121
122check_LTLIBRARIES = libtestgenc.la
123
124if WITH_CPP
125 check_LTLIBRARIES += libtestgencpp.la
126endif
127
Bryan Duxbury39fbb9a2011-01-13 18:09:51 +0000128nodist_libtestgenc_la_SOURCES = \
Roger Meier213a6642010-10-27 12:30:11 +0000129 gen-c_glib/t_test_debug_proto_test_types.c \
130 gen-c_glib/t_test_empty_service.c \
131 gen-c_glib/t_test_inherited.c \
132 gen-c_glib/t_test_optional_required_test_types.c \
133 gen-c_glib/t_test_reverse_order_service.c \
134 gen-c_glib/t_test_second_service.c \
135 gen-c_glib/t_test_service_for_exception_with_a_map.c \
136 gen-c_glib/t_test_srv.c \
137 gen-c_glib/t_test_thrift_test.c \
138 gen-c_glib/t_test_thrift_test_types.c \
139 gen-c_glib/t_test_debug_proto_test_types.h \
140 gen-c_glib/t_test_empty_service.h \
141 gen-c_glib/t_test_inherited.h \
142 gen-c_glib/t_test_optional_required_test_types.h \
143 gen-c_glib/t_test_reverse_order_service.h \
144 gen-c_glib/t_test_second_service.h \
145 gen-c_glib/t_test_service_for_exception_with_a_map.h \
146 gen-c_glib/t_test_srv.h \
147 gen-c_glib/t_test_thrift_test.h \
148 gen-c_glib/t_test_thrift_test_types.h
149libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la
150
Bryan Duxbury39fbb9a2011-01-13 18:09:51 +0000151nodist_libtestgencpp_la_SOURCES = \
Roger Meier213a6642010-10-27 12:30:11 +0000152 gen-cpp/ThriftTest.cpp \
153 gen-cpp/ThriftTest_constants.cpp \
154 gen-cpp/ThriftTest_types.cpp \
155 gen-cpp/ThriftTest.h \
156 gen-cpp/ThriftTest_constants.h \
157 gen-cpp/ThriftTest_types.h
158libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp
159
160THRIFT = $(top_builddir)/compiler/cpp/thrift
161
162gen-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 +0200163 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000164
165gen-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 +0200166 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000167
168gen-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 +0200169 $(THRIFT) --gen c_glib $<
Roger Meier213a6642010-10-27 12:30:11 +0000170
Roger Meier035870d2014-10-22 23:43:05 +0200171gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest_types.cpp: ../../../test/ThriftTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200172 $(THRIFT) --gen cpp $<
Roger Meier213a6642010-10-27 12:30:11 +0000173
Roger Meier213a6642010-10-27 12:30:11 +0000174TESTS = \
Roger Meier213a6642010-10-27 12:30:11 +0000175 $(check_PROGRAMS) \
176 $(check_SCRIPTS)
177
178# globally added to all instances of valgrind calls
179# VALGRIND_OPTS = --suppressions=glib.suppress
180VALGRIND_OPTS =
181
182# globally added to all memcheck calls
183VALGRIND_MEM_OPTS = --tool=memcheck \
184 --num-callers=10 \
185 ${myextravalgrindmemopts}
186
187# globally added to all leakcheck calls
188VALGRIND_LEAK_OPTS = --tool=memcheck \
189 --num-callers=10 \
190 --leak-check=full \
191 --leak-resolution=high \
192 ${myextravalgrindleakopts}
193
194memcheck: $(check_PROGRAMS)
Jens Geyer79f988c2014-10-03 20:42:54 +0200195 @for x in $(check_PROGRAMS); \
196 do \
197 $(MAKE) memcheck-$$x; \
198 done
Roger Meier213a6642010-10-27 12:30:11 +0000199
200leakcheck: $(check_PROGRAMS)
Jens Geyer79f988c2014-10-03 20:42:54 +0200201 @for x in $(check_PROGRAMS); \
202 do \
203 $(MAKE) leakcheck-$$x; \
204 done
Roger Meier213a6642010-10-27 12:30:11 +0000205
206memcheck-%: %
Jens Geyer79f988c2014-10-03 20:42:54 +0200207 @echo "*****************************************"; \
208 echo "MEMCHECK: $<"; \
209 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_MEM_OPTS} ${$<_VALGRIND_MEM_OPTS}"; \
210 $(LIBTOOL) --mode=execute \
211 valgrind \
212 ${VALGRIND_OPTS} \
213 ${VALGRIND_MEM_OPTS} \
214 ${$<_VALGRIND_MEM_OPTS} ./$<
Roger Meier213a6642010-10-27 12:30:11 +0000215
216leakcheck-%: %
Jens Geyer79f988c2014-10-03 20:42:54 +0200217 @echo "*****************************************"; \
218 echo "LEAKCHECK: $<"; \
219 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_LEAK_OPTS} ${$<_VALGRIND_LEAK_OPTS}"; \
220 G_SLICE=always-malloc $(LIBTOOL) --mode=execute \
221 valgrind \
222 ${VALGRIND_OPTS} \
223 ${VALGRIND_LEAK_OPTS} \
224 ${$<_VALGRIND_LEAK_OPTS} ./$<
Roger Meier213a6642010-10-27 12:30:11 +0000225
Roger Meier213a6642010-10-27 12:30:11 +0000226clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +0200227 $(RM) -r gen-c_glib gen-cpp
Roger Meier213a6642010-10-27 12:30:11 +0000228
229CLEANFILES = \
Roger Meier213a6642010-10-27 12:30:11 +0000230 *.bb \
231 *.bbg \
232 *.da \
233 *.gcno \
234 *.gcda \
Roger Meierc1010922010-11-26 10:17:48 +0000235 *.gcov