blob: 6779ac6558a90e9d504abbb879a02970cdd4df3d [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 \
23 gen-cpp/OptionalRequiredTest_types.cpp \
24 gen-cpp/DebugProtoTest_types.cpp \
25 gen-cpp/ThriftTest_types.cpp \
26 gen-cpp/DebugProtoTest_types.h \
27 gen-cpp/OptionalRequiredTest_types.h \
jfarrelle0e83162014-04-08 22:45:01 -040028 gen-cpp/Recursive_types.cpp \
29 gen-cpp/Recursive_types.h \
David Reiss351e22b2010-08-31 16:51:19 +000030 gen-cpp/ThriftTest_types.h \
31 ThriftTest_extras.cpp \
32 DebugProtoTest_extras.cpp
33
Roger Meier2b1a5282012-05-11 10:12:39 +000034nodist_libprocessortest_la_SOURCES = \
35 gen-cpp/ChildService.cpp \
36 gen-cpp/ChildService.h \
37 gen-cpp/ParentService.cpp \
38 gen-cpp/ParentService.h \
39 gen-cpp/proc_types.cpp \
40 gen-cpp/proc_types.h
41
David Reiss351e22b2010-08-31 16:51:19 +000042ThriftTest_extras.o: gen-cpp/ThriftTest_types.h
43DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h
44
45libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
46
47noinst_PROGRAMS = Benchmark
48
49Benchmark_SOURCES = \
50 Benchmark.cpp
51
52Benchmark_LDADD = libtestgencpp.la
53
54check_PROGRAMS = \
55 TFDTransportTest \
56 TPipedTransportTest \
57 DebugProtoTest \
58 JSONProtoTest \
59 OptionalRequiredTest \
jfarrelle0e83162014-04-08 22:45:01 -040060 RecursiveTest \
David Reisse71115b2010-10-06 17:09:56 +000061 SpecializationTest \
David Reiss351e22b2010-08-31 16:51:19 +000062 AllProtocolsTest \
David Reiss35dc7692010-10-06 17:10:19 +000063 TransportTest \
David Reiss9a961e72010-10-06 17:10:23 +000064 ZlibTest \
David Reiss709b69f2010-10-06 17:10:30 +000065 TFileTransportTest \
Roger Meier63fcb7e2014-06-15 21:48:59 +020066 UnitTests \
Alan Dunnbee7b732014-07-26 13:48:43 -050067 link_test \
68 OpenSSLManualInitTest
Roger Meier2d59b9e2012-05-23 19:40:40 +000069# disable these test ... too strong
70# processor_test
Roger Meierdd16f052012-05-11 14:19:48 +000071# concurrency_test
David Reiss351e22b2010-08-31 16:51:19 +000072
Roger Meier9e0f0742011-08-03 17:36:55 +000073TESTS_ENVIRONMENT= \
74 BOOST_TEST_LOG_SINK=tests.xml \
75 BOOST_TEST_LOG_LEVEL=test_suite \
76 BOOST_TEST_LOG_FORMAT=xml
77
David Reiss351e22b2010-08-31 16:51:19 +000078TESTS = \
79 $(check_PROGRAMS)
80
81UnitTests_SOURCES = \
82 UnitTestMain.cpp \
83 TMemoryBufferTest.cpp \
Roger Meier4cb8e402012-05-27 18:05:16 +000084 TBufferBaseTest.cpp \
85 Base64Test.cpp
Roger Meier12d70532011-12-14 23:35:28 +000086
87if !WITH_BOOSTTHREADS
88UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +000089 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000090endif
David Reiss351e22b2010-08-31 16:51:19 +000091
Christian Lavoie4f42ef72010-11-04 18:51:42 +000092UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +000093 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +020094 -l:libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +000095
David Reiss35dc7692010-10-06 17:10:19 +000096TransportTest_SOURCES = \
97 TransportTest.cpp
98
Christian Lavoie4f42ef72010-11-04 18:51:42 +000099TransportTest_LDADD = \
100 libtestgencpp.la \
101 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200102 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000103 -lz
David Reiss35dc7692010-10-06 17:10:19 +0000104
David Reiss9a961e72010-10-06 17:10:23 +0000105ZlibTest_SOURCES = \
106 ZlibTest.cpp
107
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000108ZlibTest_LDADD = \
109 libtestgencpp.la \
110 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200111 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000112 -lz
David Reiss9a961e72010-10-06 17:10:23 +0000113
David Reiss709b69f2010-10-06 17:10:30 +0000114TFileTransportTest_SOURCES = \
115 TFileTransportTest.cpp
116
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000117TFileTransportTest_LDADD = \
118 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200119 -l:libboost_unit_test_framework.a
David Reiss709b69f2010-10-06 17:10:30 +0000120
David Reiss351e22b2010-08-31 16:51:19 +0000121#
122# TFDTransportTest
123#
124TFDTransportTest_SOURCES = \
125 TFDTransportTest.cpp
126
127TFDTransportTest_LDADD = \
128 $(top_builddir)/lib/cpp/libthrift.la
129
130
131#
132# TPipedTransportTest
133#
134TPipedTransportTest_SOURCES = \
135 TPipedTransportTest.cpp
136
137TPipedTransportTest_LDADD = \
138 $(top_builddir)/lib/cpp/libthrift.la
139
140#
141# AllProtocolsTest
142#
143AllProtocolsTest_SOURCES = \
144 AllProtocolTests.cpp \
145 AllProtocolTests.tcc \
146 GenericHelpers.h
147
148AllProtocolsTest_LDADD = libtestgencpp.la
149
150#
151# DebugProtoTest
152#
153DebugProtoTest_SOURCES = \
154 DebugProtoTest.cpp
155
156DebugProtoTest_LDADD = libtestgencpp.la
157
158
159#
160# JSONProtoTest
161#
162JSONProtoTest_SOURCES = \
163 JSONProtoTest.cpp
164
165JSONProtoTest_LDADD = libtestgencpp.la
166
167#
168# OptionalRequiredTest
169#
170OptionalRequiredTest_SOURCES = \
171 OptionalRequiredTest.cpp
172
173OptionalRequiredTest_LDADD = libtestgencpp.la
174
David Reisse71115b2010-10-06 17:09:56 +0000175#
jfarrelle0e83162014-04-08 22:45:01 -0400176# OptionalRequiredTest
177#
178RecursiveTest_SOURCES = \
179 RecursiveTest.cpp
180
181RecursiveTest_LDADD = libtestgencpp.la
182
183#
David Reisse71115b2010-10-06 17:09:56 +0000184# SpecializationTest
185#
186SpecializationTest_SOURCES = \
187 SpecializationTest.cpp
188
189SpecializationTest_LDADD = libtestgencpp.la
190
Roger Meier2b1a5282012-05-11 10:12:39 +0000191concurrency_test_SOURCES = \
192 concurrency/Tests.cpp \
193 concurrency/ThreadFactoryTests.h \
194 concurrency/ThreadManagerTests.h \
195 concurrency/TimerManagerTests.h
David Reiss351e22b2010-08-31 16:51:19 +0000196
Roger Meier2b1a5282012-05-11 10:12:39 +0000197concurrency_test_LDADD = \
198 $(top_builddir)/lib/cpp/libthrift.la
199
Roger Meier63fcb7e2014-06-15 21:48:59 +0200200link_test_SOURCES = \
201 link/LinkTest.cpp \
202 link/TemplatedService1.cpp \
203 link/TemplatedService2.cpp
204
Roger Meier2b1a5282012-05-11 10:12:39 +0000205processor_test_SOURCES = \
206 processor/ProcessorTest.cpp \
207 processor/EventLog.cpp \
208 processor/ServerThread.cpp \
209 processor/EventLog.h \
210 processor/Handlers.h \
211 processor/ServerThread.h
212
213processor_test_LDADD = libprocessortest.la \
214 $(top_builddir)/lib/cpp/libthrift.la \
215 $(top_builddir)/lib/cpp/libthriftnb.la \
216 $(BOOST_LDFLAGS) \
217 -levent \
Roger Meier73b58a22014-05-11 17:39:34 +0200218 -l:libboost_unit_test_framework.a
Alan Dunnbee7b732014-07-26 13:48:43 -0500219
220OpenSSLManualInitTest_SOURCES = \
221 OpenSSLManualInitTest.cpp
222
223OpenSSLManualInitTest_LDADD = \
224 $(top_builddir)/lib/cpp/libthrift.la \
225 -l:libboost_unit_test_framework.a
226
David Reiss351e22b2010-08-31 16:51:19 +0000227#
228# Common thrift code generation rules
229#
230THRIFT = $(top_builddir)/compiler/cpp/thrift
231
232gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
233 $(THRIFT) --gen cpp:dense $<
234
235gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
236 $(THRIFT) --gen cpp:dense $<
237
jfarrelle0e83162014-04-08 22:45:01 -0400238gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h: $(top_srcdir)/test/Recursive.thrift
239 $(THRIFT) --gen cpp $<
240
David Reiss351e22b2010-08-31 16:51:19 +0000241gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
242 $(THRIFT) --gen cpp:dense $<
243
244gen-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
245 $(THRIFT) --gen cpp:dense $<
246
Roger Meier2b1a5282012-05-11 10:12:39 +0000247gen-cpp/ChildService.cpp: processor/proc.thrift
248 $(THRIFT) --gen cpp:templates,cob_style $<
249
David Reiss351e22b2010-08-31 16:51:19 +0000250INCLUDES = \
251 -I$(top_srcdir)/lib/cpp/src
252
253AM_CPPFLAGS = $(BOOST_CPPFLAGS)
Roger Meier38315782011-11-06 11:29:41 +0000254AM_LDFLAGS = $(BOOST_LDFLAGS)
Jake Farrellea949fb2011-12-13 20:02:33 +0000255AM_CXXFLAGS = -Wall
David Reiss351e22b2010-08-31 16:51:19 +0000256
257clean-local:
258 $(RM) -r gen-cpp
259
260EXTRA_DIST = \
David Reiss351e22b2010-08-31 16:51:19 +0000261 DenseProtoTest.cpp \
262 ThriftTest_extras.cpp \
Jake Farrell7c7a5e02012-10-11 00:29:11 +0000263 DebugProtoTest_extras.cpp \
264 concurrency \
265 processor