blob: c1fad3e3e5154e158699b65a5df92a5cef109e53 [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 \
Konrad Grochowskib3f6ea12014-09-02 16:00:47 +020085 Base64Test.cpp \
86 ToStringTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000087
88if !WITH_BOOSTTHREADS
89UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +000090 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000091endif
David Reiss351e22b2010-08-31 16:51:19 +000092
Christian Lavoie4f42ef72010-11-04 18:51:42 +000093UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +000094 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +020095 -l:libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +000096
David Reiss35dc7692010-10-06 17:10:19 +000097TransportTest_SOURCES = \
98 TransportTest.cpp
99
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000100TransportTest_LDADD = \
101 libtestgencpp.la \
102 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200103 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000104 -lz
David Reiss35dc7692010-10-06 17:10:19 +0000105
David Reiss9a961e72010-10-06 17:10:23 +0000106ZlibTest_SOURCES = \
107 ZlibTest.cpp
108
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000109ZlibTest_LDADD = \
110 libtestgencpp.la \
111 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200112 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000113 -lz
David Reiss9a961e72010-10-06 17:10:23 +0000114
David Reiss709b69f2010-10-06 17:10:30 +0000115TFileTransportTest_SOURCES = \
116 TFileTransportTest.cpp
117
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000118TFileTransportTest_LDADD = \
119 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200120 -l:libboost_unit_test_framework.a
David Reiss709b69f2010-10-06 17:10:30 +0000121
David Reiss351e22b2010-08-31 16:51:19 +0000122#
123# TFDTransportTest
124#
125TFDTransportTest_SOURCES = \
126 TFDTransportTest.cpp
127
128TFDTransportTest_LDADD = \
129 $(top_builddir)/lib/cpp/libthrift.la
130
131
132#
133# TPipedTransportTest
134#
135TPipedTransportTest_SOURCES = \
136 TPipedTransportTest.cpp
137
138TPipedTransportTest_LDADD = \
139 $(top_builddir)/lib/cpp/libthrift.la
140
141#
142# AllProtocolsTest
143#
144AllProtocolsTest_SOURCES = \
145 AllProtocolTests.cpp \
146 AllProtocolTests.tcc \
147 GenericHelpers.h
148
149AllProtocolsTest_LDADD = libtestgencpp.la
150
151#
152# DebugProtoTest
153#
154DebugProtoTest_SOURCES = \
155 DebugProtoTest.cpp
156
157DebugProtoTest_LDADD = libtestgencpp.la
158
159
160#
161# JSONProtoTest
162#
163JSONProtoTest_SOURCES = \
164 JSONProtoTest.cpp
165
166JSONProtoTest_LDADD = libtestgencpp.la
167
168#
169# OptionalRequiredTest
170#
171OptionalRequiredTest_SOURCES = \
172 OptionalRequiredTest.cpp
173
174OptionalRequiredTest_LDADD = libtestgencpp.la
175
David Reisse71115b2010-10-06 17:09:56 +0000176#
jfarrelle0e83162014-04-08 22:45:01 -0400177# OptionalRequiredTest
178#
179RecursiveTest_SOURCES = \
180 RecursiveTest.cpp
181
182RecursiveTest_LDADD = libtestgencpp.la
183
184#
David Reisse71115b2010-10-06 17:09:56 +0000185# SpecializationTest
186#
187SpecializationTest_SOURCES = \
188 SpecializationTest.cpp
189
190SpecializationTest_LDADD = libtestgencpp.la
191
Roger Meier2b1a5282012-05-11 10:12:39 +0000192concurrency_test_SOURCES = \
193 concurrency/Tests.cpp \
194 concurrency/ThreadFactoryTests.h \
195 concurrency/ThreadManagerTests.h \
196 concurrency/TimerManagerTests.h
David Reiss351e22b2010-08-31 16:51:19 +0000197
Roger Meier2b1a5282012-05-11 10:12:39 +0000198concurrency_test_LDADD = \
199 $(top_builddir)/lib/cpp/libthrift.la
200
Roger Meier63fcb7e2014-06-15 21:48:59 +0200201link_test_SOURCES = \
202 link/LinkTest.cpp \
203 link/TemplatedService1.cpp \
204 link/TemplatedService2.cpp
205
Roger Meier2b1a5282012-05-11 10:12:39 +0000206processor_test_SOURCES = \
207 processor/ProcessorTest.cpp \
208 processor/EventLog.cpp \
209 processor/ServerThread.cpp \
210 processor/EventLog.h \
211 processor/Handlers.h \
212 processor/ServerThread.h
213
214processor_test_LDADD = libprocessortest.la \
215 $(top_builddir)/lib/cpp/libthrift.la \
216 $(top_builddir)/lib/cpp/libthriftnb.la \
217 $(BOOST_LDFLAGS) \
218 -levent \
Roger Meier73b58a22014-05-11 17:39:34 +0200219 -l:libboost_unit_test_framework.a
Alan Dunnbee7b732014-07-26 13:48:43 -0500220
221OpenSSLManualInitTest_SOURCES = \
222 OpenSSLManualInitTest.cpp
223
224OpenSSLManualInitTest_LDADD = \
225 $(top_builddir)/lib/cpp/libthrift.la \
226 -l:libboost_unit_test_framework.a
227
David Reiss351e22b2010-08-31 16:51:19 +0000228#
229# Common thrift code generation rules
230#
231THRIFT = $(top_builddir)/compiler/cpp/thrift
232
233gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
234 $(THRIFT) --gen cpp:dense $<
235
236gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
237 $(THRIFT) --gen cpp:dense $<
238
jfarrelle0e83162014-04-08 22:45:01 -0400239gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h: $(top_srcdir)/test/Recursive.thrift
240 $(THRIFT) --gen cpp $<
241
David Reiss351e22b2010-08-31 16:51:19 +0000242gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
243 $(THRIFT) --gen cpp:dense $<
244
245gen-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
246 $(THRIFT) --gen cpp:dense $<
247
Roger Meier2b1a5282012-05-11 10:12:39 +0000248gen-cpp/ChildService.cpp: processor/proc.thrift
249 $(THRIFT) --gen cpp:templates,cob_style $<
250
David Reiss351e22b2010-08-31 16:51:19 +0000251INCLUDES = \
252 -I$(top_srcdir)/lib/cpp/src
253
254AM_CPPFLAGS = $(BOOST_CPPFLAGS)
Roger Meier38315782011-11-06 11:29:41 +0000255AM_LDFLAGS = $(BOOST_LDFLAGS)
Jake Farrellea949fb2011-12-13 20:02:33 +0000256AM_CXXFLAGS = -Wall
David Reiss351e22b2010-08-31 16:51:19 +0000257
258clean-local:
259 $(RM) -r gen-cpp
260
261EXTRA_DIST = \
David Reiss351e22b2010-08-31 16:51:19 +0000262 DenseProtoTest.cpp \
263 ThriftTest_extras.cpp \
Jake Farrell7c7a5e02012-10-11 00:29:11 +0000264 DebugProtoTest_extras.cpp \
265 concurrency \
266 processor