Roger Meier | c2cc61a | 2010-11-30 19:53:29 +0000 | [diff] [blame] | 1 | # |
| 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 Meier | 81a1f99 | 2014-10-22 14:09:43 +0200 | [diff] [blame] | 19 | AUTOMAKE_OPTIONS = serial-tests |
| 20 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 21 | SUBDIRS = |
| 22 | |
| 23 | AM_CPPFLAGS = -g -Wall -I../src $(GLIB_CFLAGS) |
| 24 | AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@ |
| 25 | |
| 26 | CFLAGS = @GCOV_CFLAGS@ |
| 27 | CXXFLAGS = -g |
| 28 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 29 | check_PROGRAMS = \ |
Roger Meier | 909f186 | 2014-07-24 23:52:14 +0200 | [diff] [blame] | 30 | testapplicationexception \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 31 | testtransportsocket \ |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 32 | testbinaryprotocol \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 33 | testbufferedtransport \ |
| 34 | testframedtransport \ |
| 35 | testmemorybuffer \ |
| 36 | teststruct \ |
| 37 | testsimpleserver \ |
| 38 | testdebugproto \ |
| 39 | testoptionalrequired \ |
| 40 | testthrifttest |
| 41 | |
| 42 | if WITH_CPP |
| 43 | check_PROGRAMS += testthrifttestclient |
| 44 | endif |
| 45 | |
Roger Meier | 909f186 | 2014-07-24 23:52:14 +0200 | [diff] [blame] | 46 | testapplicationexception_SOURCES = testapplicationexception.c |
| 47 | testapplicationexception_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 Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 53 | testtransportsocket_SOURCES = testtransportsocket.c |
| 54 | testtransportsocket_LDADD = \ |
| 55 | ../libthrift_c_glib_la-thrift_transport.o \ |
Roger Meier | 63243c6 | 2014-09-29 20:29:58 +0200 | [diff] [blame] | 56 | ../libthrift_c_glib_la-thrift_buffered_transport.o \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 57 | ../libthrift_c_glib_la-thrift_server_transport.o \ |
| 58 | ../libthrift_c_glib_la-thrift_server_socket.o |
| 59 | |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 60 | testbinaryprotocol_SOURCES = testbinaryprotocol.c |
| 61 | testbinaryprotocol_LDADD = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 62 | ../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 | |
| 68 | testbufferedtransport_SOURCES = testbufferedtransport.c |
| 69 | testbufferedtransport_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 | |
| 75 | testframedtransport_SOURCES = testframedtransport.c |
| 76 | testframedtransport_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 | |
| 82 | testmemorybuffer_SOURCES = testmemorybuffer.c |
| 83 | testmemorybuffer_LDADD = \ |
| 84 | ../libthrift_c_glib_la-thrift_transport.o |
| 85 | |
| 86 | teststruct_SOURCES = teststruct.c |
| 87 | teststruct_LDADD = \ |
| 88 | ../libthrift_c_glib_la-thrift_protocol.o \ |
| 89 | ../libthrift_c_glib_la-thrift_transport.o |
| 90 | |
| 91 | testsimpleserver_SOURCES = testsimpleserver.c |
| 92 | testsimpleserver_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 | |
| 105 | testdebugproto_SOURCES = testdebugproto.c |
| 106 | testdebugproto_LDADD = libtestgenc.la |
| 107 | |
| 108 | testoptionalrequired_SOURCES = testoptionalrequired.c |
| 109 | testoptionalrequired_LDADD = \ |
| 110 | ../libthrift_c_glib_la-thrift_protocol.o \ |
| 111 | ../libthrift_c_glib_la-thrift_transport.o \ |
| 112 | libtestgenc.la |
| 113 | |
| 114 | testthrifttest_SOURCES = testthrifttest.c |
| 115 | testthrifttest_LDADD = libtestgenc.la |
| 116 | |
| 117 | testthrifttestclient_SOURCES = testthrifttestclient.cpp |
| 118 | testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS) |
| 119 | testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la |
| 120 | testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS) |
| 121 | |
| 122 | check_LTLIBRARIES = libtestgenc.la |
| 123 | |
| 124 | if WITH_CPP |
| 125 | check_LTLIBRARIES += libtestgencpp.la |
| 126 | endif |
| 127 | |
Bryan Duxbury | 39fbb9a | 2011-01-13 18:09:51 +0000 | [diff] [blame] | 128 | nodist_libtestgenc_la_SOURCES = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 129 | 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 |
| 149 | libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la |
| 150 | |
Bryan Duxbury | 39fbb9a | 2011-01-13 18:09:51 +0000 | [diff] [blame] | 151 | nodist_libtestgencpp_la_SOURCES = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 152 | 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 |
| 158 | libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp |
| 159 | |
| 160 | THRIFT = $(top_builddir)/compiler/cpp/thrift |
| 161 | |
| 162 | gen-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 Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 163 | $(THRIFT) --gen c_glib $< |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 164 | |
| 165 | gen-c_glib/t_test_optional_required_test_types.c gen-c_glib/t_test_optional_required_test_types.h: ../../../test/OptionalRequiredTest.thrift |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 166 | $(THRIFT) --gen c_glib $< |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 167 | |
| 168 | gen-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 Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 169 | $(THRIFT) --gen c_glib $< |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 170 | |
Roger Meier | 035870d | 2014-10-22 23:43:05 +0200 | [diff] [blame^] | 171 | gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest_types.cpp: ../../../test/ThriftTest.thrift |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 172 | $(THRIFT) --gen cpp $< |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 173 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 174 | TESTS = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 175 | $(check_PROGRAMS) \ |
| 176 | $(check_SCRIPTS) |
| 177 | |
| 178 | # globally added to all instances of valgrind calls |
| 179 | # VALGRIND_OPTS = --suppressions=glib.suppress |
| 180 | VALGRIND_OPTS = |
| 181 | |
| 182 | # globally added to all memcheck calls |
| 183 | VALGRIND_MEM_OPTS = --tool=memcheck \ |
| 184 | --num-callers=10 \ |
| 185 | ${myextravalgrindmemopts} |
| 186 | |
| 187 | # globally added to all leakcheck calls |
| 188 | VALGRIND_LEAK_OPTS = --tool=memcheck \ |
| 189 | --num-callers=10 \ |
| 190 | --leak-check=full \ |
| 191 | --leak-resolution=high \ |
| 192 | ${myextravalgrindleakopts} |
| 193 | |
| 194 | memcheck: $(check_PROGRAMS) |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 195 | @for x in $(check_PROGRAMS); \ |
| 196 | do \ |
| 197 | $(MAKE) memcheck-$$x; \ |
| 198 | done |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 199 | |
| 200 | leakcheck: $(check_PROGRAMS) |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 201 | @for x in $(check_PROGRAMS); \ |
| 202 | do \ |
| 203 | $(MAKE) leakcheck-$$x; \ |
| 204 | done |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 205 | |
| 206 | memcheck-%: % |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 207 | @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 Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 215 | |
| 216 | leakcheck-%: % |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 217 | @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 Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 225 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 226 | clean-local: |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 227 | $(RM) -r gen-c_glib gen-cpp |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 228 | |
| 229 | CLEANFILES = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 230 | *.bb \ |
| 231 | *.bbg \ |
| 232 | *.da \ |
| 233 | *.gcno \ |
| 234 | *.gcda \ |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 235 | *.gcov |