Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 1 | SUBDIRS = |
| 2 | |
| 3 | AM_CPPFLAGS = -g -Wall -I../src $(GLIB_CFLAGS) |
| 4 | AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@ |
| 5 | |
| 6 | CFLAGS = @GCOV_CFLAGS@ |
| 7 | CXXFLAGS = -g |
| 8 | |
| 9 | check_SCRIPTS = \ |
| 10 | testwrapper-testtransportsocket \ |
| 11 | testwrapper-testprotocolbinary \ |
| 12 | testwrapper-testbufferedtransport \ |
| 13 | testwrapper-testframedtransport \ |
| 14 | testwrapper-testmemorybuffer \ |
| 15 | testwrapper-teststruct \ |
| 16 | testwrapper-testsimpleserver \ |
| 17 | testwrapper-testdebugproto \ |
| 18 | testwrapper-testoptionalrequired \ |
| 19 | testwrapper-testthrifttest |
| 20 | |
| 21 | if WITH_CPP |
| 22 | check_SCRIPTS += testwrapper-testthrifttestclient |
| 23 | endif |
| 24 | |
| 25 | check_PROGRAMS = \ |
| 26 | testtransportsocket \ |
| 27 | testprotocolbinary \ |
| 28 | testbufferedtransport \ |
| 29 | testframedtransport \ |
| 30 | testmemorybuffer \ |
| 31 | teststruct \ |
| 32 | testsimpleserver \ |
| 33 | testdebugproto \ |
| 34 | testoptionalrequired \ |
| 35 | testthrifttest |
| 36 | |
| 37 | if WITH_CPP |
| 38 | check_PROGRAMS += testthrifttestclient |
| 39 | endif |
| 40 | |
| 41 | testtransportsocket_SOURCES = testtransportsocket.c |
| 42 | testtransportsocket_LDADD = \ |
| 43 | ../libthrift_c_glib_la-thrift_transport.o \ |
| 44 | ../libthrift_c_glib_la-thrift_server_transport.o \ |
| 45 | ../libthrift_c_glib_la-thrift_server_socket.o |
| 46 | |
| 47 | testprotocolbinary_SOURCES = testprotocolbinary.c |
| 48 | testprotocolbinary_LDADD = \ |
| 49 | ../libthrift_c_glib_la-thrift_protocol.o \ |
| 50 | ../libthrift_c_glib_la-thrift_transport.o \ |
| 51 | ../libthrift_c_glib_la-thrift_socket.o \ |
| 52 | ../libthrift_c_glib_la-thrift_server_transport.o \ |
| 53 | ../libthrift_c_glib_la-thrift_server_socket.o |
| 54 | |
| 55 | testbufferedtransport_SOURCES = testbufferedtransport.c |
| 56 | testbufferedtransport_LDADD = \ |
| 57 | ../libthrift_c_glib_la-thrift_transport.o \ |
| 58 | ../libthrift_c_glib_la-thrift_socket.o \ |
| 59 | ../libthrift_c_glib_la-thrift_server_transport.o \ |
| 60 | ../libthrift_c_glib_la-thrift_server_socket.o |
| 61 | |
| 62 | testframedtransport_SOURCES = testframedtransport.c |
| 63 | testframedtransport_LDADD = \ |
| 64 | ../libthrift_c_glib_la-thrift_transport.o \ |
| 65 | ../libthrift_c_glib_la-thrift_socket.o \ |
| 66 | ../libthrift_c_glib_la-thrift_server_transport.o \ |
| 67 | ../libthrift_c_glib_la-thrift_server_socket.o |
| 68 | |
| 69 | testmemorybuffer_SOURCES = testmemorybuffer.c |
| 70 | testmemorybuffer_LDADD = \ |
| 71 | ../libthrift_c_glib_la-thrift_transport.o |
| 72 | |
| 73 | teststruct_SOURCES = teststruct.c |
| 74 | teststruct_LDADD = \ |
| 75 | ../libthrift_c_glib_la-thrift_protocol.o \ |
| 76 | ../libthrift_c_glib_la-thrift_transport.o |
| 77 | |
| 78 | testsimpleserver_SOURCES = testsimpleserver.c |
| 79 | testsimpleserver_LDADD = \ |
| 80 | ../libthrift_c_glib_la-thrift_protocol.o \ |
| 81 | ../libthrift_c_glib_la-thrift_transport.o \ |
| 82 | ../libthrift_c_glib_la-thrift_transport_factory.o \ |
| 83 | ../libthrift_c_glib_la-thrift_processor.o \ |
| 84 | ../libthrift_c_glib_la-thrift_protocol_factory.o \ |
| 85 | ../libthrift_c_glib_la-thrift_binary_protocol.o \ |
| 86 | ../libthrift_c_glib_la-thrift_binary_protocol_factory.o \ |
| 87 | ../libthrift_c_glib_la-thrift_socket.o \ |
| 88 | ../libthrift_c_glib_la-thrift_server_transport.o \ |
| 89 | ../libthrift_c_glib_la-thrift_server_socket.o \ |
| 90 | ../libthrift_c_glib_la-thrift_server.o |
| 91 | |
| 92 | testdebugproto_SOURCES = testdebugproto.c |
| 93 | testdebugproto_LDADD = libtestgenc.la |
| 94 | |
| 95 | testoptionalrequired_SOURCES = testoptionalrequired.c |
| 96 | testoptionalrequired_LDADD = \ |
| 97 | ../libthrift_c_glib_la-thrift_protocol.o \ |
| 98 | ../libthrift_c_glib_la-thrift_transport.o \ |
| 99 | libtestgenc.la |
| 100 | |
| 101 | testthrifttest_SOURCES = testthrifttest.c |
| 102 | testthrifttest_LDADD = libtestgenc.la |
| 103 | |
| 104 | testthrifttestclient_SOURCES = testthrifttestclient.cpp |
| 105 | testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS) |
| 106 | testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la |
| 107 | testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS) |
| 108 | |
| 109 | check_LTLIBRARIES = libtestgenc.la |
| 110 | |
| 111 | if WITH_CPP |
| 112 | check_LTLIBRARIES += libtestgencpp.la |
| 113 | endif |
| 114 | |
| 115 | libtestgenc_la_SOURCES = \ |
| 116 | gen-c_glib/t_test_debug_proto_test_types.c \ |
| 117 | gen-c_glib/t_test_empty_service.c \ |
| 118 | gen-c_glib/t_test_inherited.c \ |
| 119 | gen-c_glib/t_test_optional_required_test_types.c \ |
| 120 | gen-c_glib/t_test_reverse_order_service.c \ |
| 121 | gen-c_glib/t_test_second_service.c \ |
| 122 | gen-c_glib/t_test_service_for_exception_with_a_map.c \ |
| 123 | gen-c_glib/t_test_srv.c \ |
| 124 | gen-c_glib/t_test_thrift_test.c \ |
| 125 | gen-c_glib/t_test_thrift_test_types.c \ |
| 126 | gen-c_glib/t_test_debug_proto_test_types.h \ |
| 127 | gen-c_glib/t_test_empty_service.h \ |
| 128 | gen-c_glib/t_test_inherited.h \ |
| 129 | gen-c_glib/t_test_optional_required_test_types.h \ |
| 130 | gen-c_glib/t_test_reverse_order_service.h \ |
| 131 | gen-c_glib/t_test_second_service.h \ |
| 132 | gen-c_glib/t_test_service_for_exception_with_a_map.h \ |
| 133 | gen-c_glib/t_test_srv.h \ |
| 134 | gen-c_glib/t_test_thrift_test.h \ |
| 135 | gen-c_glib/t_test_thrift_test_types.h |
| 136 | libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la |
| 137 | |
| 138 | libtestgencpp_la_SOURCES = \ |
| 139 | gen-cpp/ThriftTest.cpp \ |
| 140 | gen-cpp/ThriftTest_constants.cpp \ |
| 141 | gen-cpp/ThriftTest_types.cpp \ |
| 142 | gen-cpp/ThriftTest.h \ |
| 143 | gen-cpp/ThriftTest_constants.h \ |
| 144 | gen-cpp/ThriftTest_types.h |
| 145 | libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp |
| 146 | |
| 147 | THRIFT = $(top_builddir)/compiler/cpp/thrift |
| 148 | |
| 149 | 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 |
| 150 | $(THRIFT) --gen c_glib $< |
| 151 | |
| 152 | gen-c_glib/t_test_optional_required_test_types.c gen-c_glib/t_test_optional_required_test_types.h: ../../../test/OptionalRequiredTest.thrift |
| 153 | $(THRIFT) --gen c_glib $< |
| 154 | |
| 155 | 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 |
| 156 | $(THRIFT) --gen c_glib $< |
| 157 | |
| 158 | gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest.h: ../../../test/ThriftTest.thrift |
| 159 | $(THRIFT) --gen cpp $< |
| 160 | |
| 161 | |
| 162 | TESTS = \ |
| 163 | $(testwrapper-%) \ |
| 164 | $(check_PROGRAMS) \ |
| 165 | $(check_SCRIPTS) |
| 166 | |
| 167 | # globally added to all instances of valgrind calls |
| 168 | # VALGRIND_OPTS = --suppressions=glib.suppress |
| 169 | VALGRIND_OPTS = |
| 170 | |
| 171 | # globally added to all memcheck calls |
| 172 | VALGRIND_MEM_OPTS = --tool=memcheck \ |
| 173 | --num-callers=10 \ |
| 174 | ${myextravalgrindmemopts} |
| 175 | |
| 176 | # globally added to all leakcheck calls |
| 177 | VALGRIND_LEAK_OPTS = --tool=memcheck \ |
| 178 | --num-callers=10 \ |
| 179 | --leak-check=full \ |
| 180 | --leak-resolution=high \ |
| 181 | ${myextravalgrindleakopts} |
| 182 | |
| 183 | memcheck: $(check_PROGRAMS) |
| 184 | @for x in $(check_PROGRAMS); \ |
| 185 | do \ |
| 186 | $(MAKE) memcheck-$$x; \ |
| 187 | done |
| 188 | |
| 189 | leakcheck: $(check_PROGRAMS) |
| 190 | @for x in $(check_PROGRAMS); \ |
| 191 | do \ |
| 192 | $(MAKE) leakcheck-$$x; \ |
| 193 | done |
| 194 | |
| 195 | memcheck-%: % |
| 196 | @echo "*****************************************"; \ |
| 197 | echo "MEMCHECK: $<"; \ |
| 198 | echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_MEM_OPTS} ${$<_VALGRIND_MEM_OPTS}"; \ |
| 199 | $(LIBTOOL) --mode=execute \ |
| 200 | valgrind \ |
| 201 | ${VALGRIND_OPTS} \ |
| 202 | ${VALGRIND_MEM_OPTS} \ |
| 203 | ${$<_VALGRIND_MEM_OPTS} ./$< |
| 204 | |
| 205 | leakcheck-%: % |
| 206 | @echo "*****************************************"; \ |
| 207 | echo "LEAKCHECK: $<"; \ |
| 208 | echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_LEAK_OPTS} ${$<_VALGRIND_LEAK_OPTS}"; \ |
| 209 | G_SLICE=always-malloc $(LIBTOOL) --mode=execute \ |
| 210 | valgrind \ |
| 211 | ${VALGRIND_OPTS} \ |
| 212 | ${VALGRIND_LEAK_OPTS} \ |
| 213 | ${$<_VALGRIND_LEAK_OPTS} ./$< |
| 214 | |
| 215 | testwrapper-%: % test-wrapper.sh |
| 216 | @ln -sf test-wrapper.sh $@ |
| 217 | |
| 218 | clean-local: |
| 219 | $(RM) -r gen-c_glib gen-cpp |
| 220 | |
| 221 | CLEANFILES = \ |
| 222 | testwrapper-* \ |
| 223 | *.bb \ |
| 224 | *.bbg \ |
| 225 | *.da \ |
| 226 | *.gcno \ |
| 227 | *.gcda \ |
| 228 | *.gcov \ |
| 229 | test-wrapper.sh |