blob: e68e66b6f9fb13943baaf129ee4b17849c414b58 [file] [log] [blame]
David Reiss351e22b2010-08-31 16:51:19 +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 Meierc0959192013-01-15 23:20:19 +010019.NOTPARALLEL:
Roger Meier2b1a5282012-05-11 10:12:39 +000020noinst_LTLIBRARIES = libtestgencpp.la libprocessortest.la
David Reiss351e22b2010-08-31 16:51:19 +000021nodist_libtestgencpp_la_SOURCES = \
22 gen-cpp/DebugProtoTest_types.cpp \
Jens Geyerae0b22c2014-09-04 23:04:21 +020023 gen-cpp/EnumTest_types.cpp \
24 gen-cpp/EnumTest_types.h \
David Reiss351e22b2010-08-31 16:51:19 +000025 gen-cpp/OptionalRequiredTest_types.cpp \
26 gen-cpp/DebugProtoTest_types.cpp \
27 gen-cpp/ThriftTest_types.cpp \
28 gen-cpp/DebugProtoTest_types.h \
29 gen-cpp/OptionalRequiredTest_types.h \
jfarrelle0e83162014-04-08 22:45:01 -040030 gen-cpp/Recursive_types.cpp \
31 gen-cpp/Recursive_types.h \
David Reiss351e22b2010-08-31 16:51:19 +000032 gen-cpp/ThriftTest_types.h \
33 ThriftTest_extras.cpp \
34 DebugProtoTest_extras.cpp
35
Roger Meier2b1a5282012-05-11 10:12:39 +000036nodist_libprocessortest_la_SOURCES = \
37 gen-cpp/ChildService.cpp \
38 gen-cpp/ChildService.h \
39 gen-cpp/ParentService.cpp \
40 gen-cpp/ParentService.h \
41 gen-cpp/proc_types.cpp \
42 gen-cpp/proc_types.h
43
David Reiss351e22b2010-08-31 16:51:19 +000044ThriftTest_extras.o: gen-cpp/ThriftTest_types.h
45DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h
46
47libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
48
49noinst_PROGRAMS = Benchmark
50
51Benchmark_SOURCES = \
52 Benchmark.cpp
53
54Benchmark_LDADD = libtestgencpp.la
55
56check_PROGRAMS = \
57 TFDTransportTest \
58 TPipedTransportTest \
59 DebugProtoTest \
60 JSONProtoTest \
61 OptionalRequiredTest \
jfarrelle0e83162014-04-08 22:45:01 -040062 RecursiveTest \
David Reisse71115b2010-10-06 17:09:56 +000063 SpecializationTest \
David Reiss351e22b2010-08-31 16:51:19 +000064 AllProtocolsTest \
David Reiss35dc7692010-10-06 17:10:19 +000065 TransportTest \
David Reiss9a961e72010-10-06 17:10:23 +000066 ZlibTest \
David Reiss709b69f2010-10-06 17:10:30 +000067 TFileTransportTest \
Roger Meier63fcb7e2014-06-15 21:48:59 +020068 UnitTests \
Alan Dunnbee7b732014-07-26 13:48:43 -050069 link_test \
Jens Geyerae0b22c2014-09-04 23:04:21 +020070 OpenSSLManualInitTest \
71 EnumTest
Roger Meier2d59b9e2012-05-23 19:40:40 +000072# disable these test ... too strong
73# processor_test
Roger Meierdd16f052012-05-11 14:19:48 +000074# concurrency_test
David Reiss351e22b2010-08-31 16:51:19 +000075
Roger Meier9e0f0742011-08-03 17:36:55 +000076TESTS_ENVIRONMENT= \
77 BOOST_TEST_LOG_SINK=tests.xml \
78 BOOST_TEST_LOG_LEVEL=test_suite \
79 BOOST_TEST_LOG_FORMAT=xml
80
David Reiss351e22b2010-08-31 16:51:19 +000081TESTS = \
82 $(check_PROGRAMS)
83
84UnitTests_SOURCES = \
85 UnitTestMain.cpp \
86 TMemoryBufferTest.cpp \
Roger Meier4cb8e402012-05-27 18:05:16 +000087 TBufferBaseTest.cpp \
Konrad Grochowskib3f6ea12014-09-02 16:00:47 +020088 Base64Test.cpp \
89 ToStringTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000090
91if !WITH_BOOSTTHREADS
92UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +000093 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000094endif
David Reiss351e22b2010-08-31 16:51:19 +000095
Christian Lavoie4f42ef72010-11-04 18:51:42 +000096UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +000097 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +020098 -l:libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +000099
David Reiss35dc7692010-10-06 17:10:19 +0000100TransportTest_SOURCES = \
101 TransportTest.cpp
102
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000103TransportTest_LDADD = \
104 libtestgencpp.la \
105 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200106 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000107 -lz
David Reiss35dc7692010-10-06 17:10:19 +0000108
David Reiss9a961e72010-10-06 17:10:23 +0000109ZlibTest_SOURCES = \
110 ZlibTest.cpp
111
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000112ZlibTest_LDADD = \
113 libtestgencpp.la \
114 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200115 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000116 -lz
David Reiss9a961e72010-10-06 17:10:23 +0000117
Jens Geyerae0b22c2014-09-04 23:04:21 +0200118EnumTest_SOURCES = \
119 EnumTest.cpp
120
121EnumTest_LDADD = \
122 libtestgencpp.la \
123 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
124
David Reiss709b69f2010-10-06 17:10:30 +0000125TFileTransportTest_SOURCES = \
126 TFileTransportTest.cpp
127
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000128TFileTransportTest_LDADD = \
129 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200130 -l:libboost_unit_test_framework.a
David Reiss709b69f2010-10-06 17:10:30 +0000131
David Reiss351e22b2010-08-31 16:51:19 +0000132#
133# TFDTransportTest
134#
135TFDTransportTest_SOURCES = \
136 TFDTransportTest.cpp
137
138TFDTransportTest_LDADD = \
139 $(top_builddir)/lib/cpp/libthrift.la
140
141
142#
143# TPipedTransportTest
144#
145TPipedTransportTest_SOURCES = \
146 TPipedTransportTest.cpp
147
148TPipedTransportTest_LDADD = \
149 $(top_builddir)/lib/cpp/libthrift.la
150
151#
152# AllProtocolsTest
153#
154AllProtocolsTest_SOURCES = \
155 AllProtocolTests.cpp \
156 AllProtocolTests.tcc \
157 GenericHelpers.h
158
159AllProtocolsTest_LDADD = libtestgencpp.la
160
161#
162# DebugProtoTest
163#
164DebugProtoTest_SOURCES = \
165 DebugProtoTest.cpp
166
167DebugProtoTest_LDADD = libtestgencpp.la
168
169
170#
171# JSONProtoTest
172#
173JSONProtoTest_SOURCES = \
174 JSONProtoTest.cpp
175
176JSONProtoTest_LDADD = libtestgencpp.la
177
178#
179# OptionalRequiredTest
180#
181OptionalRequiredTest_SOURCES = \
182 OptionalRequiredTest.cpp
183
184OptionalRequiredTest_LDADD = libtestgencpp.la
185
David Reisse71115b2010-10-06 17:09:56 +0000186#
jfarrelle0e83162014-04-08 22:45:01 -0400187# OptionalRequiredTest
188#
189RecursiveTest_SOURCES = \
190 RecursiveTest.cpp
191
192RecursiveTest_LDADD = libtestgencpp.la
193
194#
David Reisse71115b2010-10-06 17:09:56 +0000195# SpecializationTest
196#
197SpecializationTest_SOURCES = \
198 SpecializationTest.cpp
199
200SpecializationTest_LDADD = libtestgencpp.la
201
Roger Meier2b1a5282012-05-11 10:12:39 +0000202concurrency_test_SOURCES = \
203 concurrency/Tests.cpp \
204 concurrency/ThreadFactoryTests.h \
205 concurrency/ThreadManagerTests.h \
206 concurrency/TimerManagerTests.h
David Reiss351e22b2010-08-31 16:51:19 +0000207
Roger Meier2b1a5282012-05-11 10:12:39 +0000208concurrency_test_LDADD = \
209 $(top_builddir)/lib/cpp/libthrift.la
210
Roger Meier63fcb7e2014-06-15 21:48:59 +0200211link_test_SOURCES = \
212 link/LinkTest.cpp \
213 link/TemplatedService1.cpp \
214 link/TemplatedService2.cpp
215
Roger Meier2b1a5282012-05-11 10:12:39 +0000216processor_test_SOURCES = \
217 processor/ProcessorTest.cpp \
218 processor/EventLog.cpp \
219 processor/ServerThread.cpp \
220 processor/EventLog.h \
221 processor/Handlers.h \
222 processor/ServerThread.h
223
224processor_test_LDADD = libprocessortest.la \
225 $(top_builddir)/lib/cpp/libthrift.la \
226 $(top_builddir)/lib/cpp/libthriftnb.la \
227 $(BOOST_LDFLAGS) \
228 -levent \
Roger Meier73b58a22014-05-11 17:39:34 +0200229 -l:libboost_unit_test_framework.a
Alan Dunnbee7b732014-07-26 13:48:43 -0500230
231OpenSSLManualInitTest_SOURCES = \
232 OpenSSLManualInitTest.cpp
233
234OpenSSLManualInitTest_LDADD = \
235 $(top_builddir)/lib/cpp/libthrift.la \
236 -l:libboost_unit_test_framework.a
237
David Reiss351e22b2010-08-31 16:51:19 +0000238#
239# Common thrift code generation rules
240#
241THRIFT = $(top_builddir)/compiler/cpp/thrift
242
243gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
244 $(THRIFT) --gen cpp:dense $<
245
Jens Geyerae0b22c2014-09-04 23:04:21 +0200246gen-cpp/EnumTest_types.cpp gen-cpp/EnumTest_types.h: $(top_srcdir)/test/EnumTest.thrift
247 $(THRIFT) --gen cpp $<
248
David Reiss351e22b2010-08-31 16:51:19 +0000249gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
250 $(THRIFT) --gen cpp:dense $<
251
jfarrelle0e83162014-04-08 22:45:01 -0400252gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h: $(top_srcdir)/test/Recursive.thrift
253 $(THRIFT) --gen cpp $<
254
David Reiss351e22b2010-08-31 16:51:19 +0000255gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
256 $(THRIFT) --gen cpp:dense $<
257
258gen-cpp/SecondService.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_types.cpp gen-cpp/ThriftTest_types.h: $(top_srcdir)/test/ThriftTest.thrift
259 $(THRIFT) --gen cpp:dense $<
260
Roger Meier2b1a5282012-05-11 10:12:39 +0000261gen-cpp/ChildService.cpp: processor/proc.thrift
262 $(THRIFT) --gen cpp:templates,cob_style $<
263
David Reiss351e22b2010-08-31 16:51:19 +0000264INCLUDES = \
265 -I$(top_srcdir)/lib/cpp/src
266
267AM_CPPFLAGS = $(BOOST_CPPFLAGS)
Roger Meier38315782011-11-06 11:29:41 +0000268AM_LDFLAGS = $(BOOST_LDFLAGS)
Jake Farrellea949fb2011-12-13 20:02:33 +0000269AM_CXXFLAGS = -Wall
David Reiss351e22b2010-08-31 16:51:19 +0000270
271clean-local:
272 $(RM) -r gen-cpp
273
274EXTRA_DIST = \
David Reiss351e22b2010-08-31 16:51:19 +0000275 DenseProtoTest.cpp \
276 ThriftTest_extras.cpp \
Jake Farrell7c7a5e02012-10-11 00:29:11 +0000277 DebugProtoTest_extras.cpp \
278 concurrency \
279 processor